diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 34cfc76f31..2ed6a1eed6 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -14,21 +14,21 @@ ignorePatterns: plugins: - file-progress - tss-unused-classes - - "@foxglove/eslint-plugin-studio" + - "@lichtblick/eslint-plugin-suite" extends: - - plugin:@foxglove/base - - plugin:@foxglove/react - - plugin:@foxglove/jest + - plugin:@lichtblick/base + - plugin:@lichtblick/react + - plugin:@lichtblick/jest - plugin:storybook/recommended - - plugin:@foxglove/studio/all + - plugin:@lichtblick/suite/all settings: - import/internal-regex: "^@foxglove" + import/internal-regex: "^@lichtblick" rules: - "@foxglove/license-header": error - "@foxglove/prefer-hash-private": error + "@lichtblick/license-header": error + "@lichtblick/prefer-hash-private": error tss-unused-classes/unused-classes: error @@ -130,7 +130,7 @@ rules: overrides: - files: ["*.ts", "*.tsx"] extends: - - plugin:@foxglove/typescript + - plugin:@lichtblick/typescript parserOptions: project: ./tsconfig.eslint.json rules: @@ -160,7 +160,7 @@ overrides: # https://eslint.org/docs/latest/rules/no-loop-func "no-loop-func": error - # unused vars must have `_` prefix, but `_` alone is not ignored (see @foxglove/studio/lodash-imports) + # unused vars must have `_` prefix, but `_` alone is not ignored (see @lichtblick/suite/lodash-imports) "@typescript-eslint/no-unused-vars": - error - vars: all diff --git a/.storybook/main.ts b/.storybook/main.ts index 17227bae4d..5899475735 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /* eslint-disable filenames/match-exported */ -import { makeConfig } from "@lichtblick/suite-base/webpack"; import { StorybookConfig } from "@storybook/react-webpack5"; import path from "path"; import { Configuration } from "webpack"; +import { makeConfig } from "@lichtblick/suite-base/webpack"; + const storybookConfig: StorybookConfig = { // Workaround for https://github.com/storybookjs/storybook/issues/19446 stories: ["../packages/**/!(node_modules)**/*.stories.tsx"], diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 06f2fc3d85..33c55c31a5 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { GlobalStyles } from "@mui/material"; +import { Story, StoryContext } from "@storybook/react"; +import { useMemo, useRef, useEffect } from "react"; +import { useTranslation } from "react-i18next"; + import { Condvar } from "@lichtblick/den/async"; import CssBaseline from "@lichtblick/suite-base/components/CssBaseline"; import GlobalCss from "@lichtblick/suite-base/components/GlobalCss"; @@ -14,10 +22,6 @@ import ReadySignalContext from "@lichtblick/suite-base/stories/ReadySignalContex import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; import waitForFonts from "@lichtblick/suite-base/util/waitForFonts"; -import { GlobalStyles } from "@mui/material"; -import { Story, StoryContext } from "@storybook/react"; -import { useMemo, useRef, useEffect } from "react"; -import { useTranslation } from "react-i18next"; import "./styles.css"; diff --git a/benchmark/src/BenchmarkStats.ts b/benchmark/src/BenchmarkStats.ts index 261858c5bc..1eb8d9ae9c 100644 --- a/benchmark/src/BenchmarkStats.ts +++ b/benchmark/src/BenchmarkStats.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; import { std } from "mathjs"; +import Log from "@lichtblick/log"; + const log = Log.getLogger(__filename); type Sample = { diff --git a/benchmark/src/Root.tsx b/benchmark/src/Root.tsx index 738e61197d..a992d882df 100644 --- a/benchmark/src/Root.tsx +++ b/benchmark/src/Root.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo, useState } from "react"; + import { SharedRoot, IDataSourceFactory, @@ -9,7 +14,6 @@ import { LaunchPreferenceValue, StudioApp, } from "@lichtblick/suite-base"; -import { useMemo, useState } from "react"; import { McapLocalBenchmarkDataSourceFactory, SyntheticDataSourceFactory } from "./dataSources"; import { LAYOUTS } from "./layouts"; diff --git a/benchmark/src/dataSources/McapLocalBenchmarkDataSourceFactory.ts b/benchmark/src/dataSources/McapLocalBenchmarkDataSourceFactory.ts index f669256db7..c8c5e9912a 100644 --- a/benchmark/src/dataSources/McapLocalBenchmarkDataSourceFactory.ts +++ b/benchmark/src/dataSources/McapLocalBenchmarkDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/dataSources/SyntheticDataSourceFactory.ts b/benchmark/src/dataSources/SyntheticDataSourceFactory.ts index 6d737315c4..0134b30e8f 100644 --- a/benchmark/src/dataSources/SyntheticDataSourceFactory.ts +++ b/benchmark/src/dataSources/SyntheticDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/dataSources/index.ts b/benchmark/src/dataSources/index.ts index 4f64b2cdba..2b9491b78e 100644 --- a/benchmark/src/dataSources/index.ts +++ b/benchmark/src/dataSources/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/index.tsx b/benchmark/src/index.tsx index 1fef426132..0899d77744 100644 --- a/benchmark/src/index.tsx +++ b/benchmark/src/index.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import ReactDOM from "react-dom"; + import Logger from "@lichtblick/log"; import { initI18n } from "@lichtblick/suite-base"; -import ReactDOM from "react-dom"; const log = Logger.getLogger(__filename); log.debug("initializing"); diff --git a/benchmark/src/layouts.ts b/benchmark/src/layouts.ts index b1bc7263fd..91c744eb42 100644 --- a/benchmark/src/layouts.ts +++ b/benchmark/src/layouts.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/players/BenchmarkPlayer.ts b/benchmark/src/players/BenchmarkPlayer.ts index a643eef99b..13769d5178 100644 --- a/benchmark/src/players/BenchmarkPlayer.ts +++ b/benchmark/src/players/BenchmarkPlayer.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toRFC3339String } from "@foxglove/rostime"; + import { filterMap } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite"; @@ -21,8 +26,6 @@ import { } from "@lichtblick/suite-base/players/types"; import delay from "@lichtblick/suite-base/util/delay"; -import { toRFC3339String } from "@foxglove/rostime"; - const log = Log.getLogger(__filename); const DEFAULT_CACHE_SIZE_BYTES = 1.0e9; diff --git a/benchmark/src/players/PointcloudPlayer.ts b/benchmark/src/players/PointcloudPlayer.ts index 165cec568d..c83c28bdb6 100644 --- a/benchmark/src/players/PointcloudPlayer.ts +++ b/benchmark/src/players/PointcloudPlayer.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as rostime from "@foxglove/rostime"; +import { Time } from "@foxglove/rostime"; + import Log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; @@ -17,9 +23,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import * as rostime from "@foxglove/rostime"; -import { Time } from "@foxglove/rostime"; - import { BenchmarkStats } from "../BenchmarkStats"; const log = Log.getLogger(__filename); diff --git a/benchmark/src/players/SinewavePlayer.ts b/benchmark/src/players/SinewavePlayer.ts index af2202bbb8..7a9a18ffcd 100644 --- a/benchmark/src/players/SinewavePlayer.ts +++ b/benchmark/src/players/SinewavePlayer.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as rostime from "@foxglove/rostime"; +import { Time } from "@foxglove/rostime"; + import Log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; @@ -17,9 +23,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import * as rostime from "@foxglove/rostime"; -import { Time } from "@foxglove/rostime"; - import { BenchmarkStats } from "../BenchmarkStats"; const log = Log.getLogger(__filename); diff --git a/benchmark/src/players/TransformPlayer.ts b/benchmark/src/players/TransformPlayer.ts index 915d724f9e..5f51a2cd5f 100644 --- a/benchmark/src/players/TransformPlayer.ts +++ b/benchmark/src/players/TransformPlayer.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as rostime from "@foxglove/rostime"; +import { Time } from "@foxglove/rostime"; +import { FrameTransform } from "@foxglove/schemas"; + import Log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; @@ -18,10 +25,6 @@ import { import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { Quaternion } from "@lichtblick/suite-base/util/geometry"; -import * as rostime from "@foxglove/rostime"; -import { Time } from "@foxglove/rostime"; -import { FrameTransform } from "@foxglove/schemas"; - import { now } from "./time"; import { BenchmarkStats } from "../BenchmarkStats"; diff --git a/benchmark/src/players/TransformPreloadingPlayer.ts b/benchmark/src/players/TransformPreloadingPlayer.ts index a02e2c6496..8bd783fee9 100644 --- a/benchmark/src/players/TransformPreloadingPlayer.ts +++ b/benchmark/src/players/TransformPreloadingPlayer.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, compare } from "@foxglove/rostime"; +import { FrameTransform, Vector3 } from "@foxglove/schemas"; + import Log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; @@ -22,9 +28,6 @@ import { import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import delay from "@lichtblick/suite-base/util/delay"; -import { Time, compare } from "@foxglove/rostime"; -import { FrameTransform, Vector3 } from "@foxglove/schemas"; - const log = Log.getLogger(__filename); const CAPABILITIES: string[] = [PlayerCapabilities.playbackControl]; diff --git a/benchmark/src/players/index.ts b/benchmark/src/players/index.ts index 914c62ffc6..2260dbe32e 100644 --- a/benchmark/src/players/index.ts +++ b/benchmark/src/players/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/players/time.ts b/benchmark/src/players/time.ts index c005224e72..92d07ac4ae 100644 --- a/benchmark/src/players/time.ts +++ b/benchmark/src/players/time.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/services/MemoryAppConfiguration.tsx b/benchmark/src/services/MemoryAppConfiguration.tsx index e49626c419..44f580d775 100644 --- a/benchmark/src/services/MemoryAppConfiguration.tsx +++ b/benchmark/src/services/MemoryAppConfiguration.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/src/services/index.ts b/benchmark/src/services/index.ts index cc109e36aa..a1f87e9683 100644 --- a/benchmark/src/services/index.ts +++ b/benchmark/src/services/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/benchmark/webpack.config.ts b/benchmark/webpack.config.ts index 3d9d26c38c..3d3d8feb39 100644 --- a/benchmark/webpack.config.ts +++ b/benchmark/webpack.config.ts @@ -1,9 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; -import { makeConfig } from "@lichtblick/suite-base/webpack"; import ReactRefreshPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import { CleanWebpackPlugin } from "clean-webpack-plugin"; import HtmlWebpackPlugin from "html-webpack-plugin"; @@ -11,6 +12,9 @@ import path from "path"; import { Configuration, WebpackPluginInstance } from "webpack"; import type { Configuration as WebpackDevServerConfiguration } from "webpack-dev-server"; +import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; +import { makeConfig } from "@lichtblick/suite-base/webpack"; + interface WebpackConfiguration extends Configuration { devServer?: WebpackDevServerConfiguration; } diff --git a/ci/bump-nightly-version.ts b/ci/bump-nightly-version.ts index c4b75f04c1..1001b70b5a 100644 --- a/ci/bump-nightly-version.ts +++ b/ci/bump-nightly-version.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/ci/exec.ts b/ci/exec.ts index a721e2ee78..02044d1aa5 100644 --- a/ci/exec.ts +++ b/ci/exec.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/ci/license-check.ts b/ci/license-check.ts index d0c8fa62c4..5a4ce0bfad 100644 --- a/ci/license-check.ts +++ b/ci/license-check.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/ci/lint-dependencies.ts b/ci/lint-dependencies.ts index c350d3187c..66d40f9ca3 100644 --- a/ci/lint-dependencies.ts +++ b/ci/lint-dependencies.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/ci/lint-unused-exports.ts b/ci/lint-unused-exports.ts index ca1a4d76c6..0f8d9410ba 100644 --- a/ci/lint-unused-exports.ts +++ b/ci/lint-unused-exports.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/electronBuilderConfig.js b/desktop/electronBuilderConfig.js index 553d5e42cf..e4c308735f 100644 --- a/desktop/electronBuilderConfig.js +++ b/desktop/electronBuilderConfig.js @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +const path = require("path"); + const { makeElectronBuilderConfig, } = require("@lichtblick/suite-desktop/src/electronBuilderConfig"); -const path = require("path"); module.exports = makeElectronBuilderConfig({ appPath: path.resolve(__dirname, ".webpack"), diff --git a/desktop/integration-test/build.ts b/desktop/integration-test/build.ts index 969457e49d..dc1edbe6dd 100644 --- a/desktop/integration-test/build.ts +++ b/desktop/integration-test/build.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/integration-test/buildSize.test.ts b/desktop/integration-test/buildSize.test.ts index 062d89bf76..97468a9b6e 100644 --- a/desktop/integration-test/buildSize.test.ts +++ b/desktop/integration-test/buildSize.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/integration-test/launchApp.ts b/desktop/integration-test/launchApp.ts index 912bec78ae..0760b1a235 100644 --- a/desktop/integration-test/launchApp.ts +++ b/desktop/integration-test/launchApp.ts @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { signal } from "@lichtblick/den/async"; -import Logger from "@lichtblick/log"; import electronPath from "electron"; import { mkdtemp } from "fs/promises"; import * as os from "os"; import * as path from "path"; import { ConsoleMessage, _electron as electron, ElectronApplication, Page } from "playwright"; +import { signal } from "@lichtblick/den/async"; +import Logger from "@lichtblick/log"; + import { appPath } from "./build"; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/desktop/integration-test/menus.test.ts b/desktop/integration-test/menus.test.ts index 4a37758e5d..c7c577e978 100644 --- a/desktop/integration-test/menus.test.ts +++ b/desktop/integration-test/menus.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/integration-test/startup.test.ts b/desktop/integration-test/startup.test.ts index 5040d05d91..2b95dae25b 100644 --- a/desktop/integration-test/startup.test.ts +++ b/desktop/integration-test/startup.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/main/index.ts b/desktop/main/index.ts index 0984763a0c..27abd8c4fd 100644 --- a/desktop/main/index.ts +++ b/desktop/main/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/preload/index.ts b/desktop/preload/index.ts index 3f67ad803e..239d0bf290 100644 --- a/desktop/preload/index.ts +++ b/desktop/preload/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/quicklook/index.ts b/desktop/quicklook/index.ts index 997bf4bed9..fc7ed16c80 100644 --- a/desktop/quicklook/index.ts +++ b/desktop/quicklook/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/renderer/index.ts b/desktop/renderer/index.ts index 57b4bfce42..b859d2ea79 100644 --- a/desktop/renderer/index.ts +++ b/desktop/renderer/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/desktop/webpack.config.ts b/desktop/webpack.config.ts index 8fa1c0d973..4e9f69e2ab 100644 --- a/desktop/webpack.config.ts +++ b/desktop/webpack.config.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import path from "path"; + import { WebpackConfigParams } from "@lichtblick/suite-desktop/src/WebpackConfigParams"; import { webpackDevServerConfig } from "@lichtblick/suite-desktop/src/webpackDevServerConfig"; import { webpackMainConfig } from "@lichtblick/suite-desktop/src/webpackMainConfig"; import { webpackPreloadConfig } from "@lichtblick/suite-desktop/src/webpackPreloadConfig"; import { webpackQuicklookConfig } from "@lichtblick/suite-desktop/src/webpackQuicklookConfig"; import { webpackRendererConfig } from "@lichtblick/suite-desktop/src/webpackRendererConfig"; -import path from "path"; import packageJson from "../package.json"; diff --git a/eslint-test.ts b/eslint-test.ts index dcc8a54b30..c6032be214 100644 --- a/eslint-test.ts +++ b/eslint-test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -30,13 +33,13 @@ function useEffectOnce() {} // eslint-disable-line id-denylist, @typescript-eslint/no-unused-vars class Foo { - private bar = 1; // eslint-disable-line @foxglove/prefer-hash-private - private static baz = 1; // eslint-disable-line @foxglove/prefer-hash-private - // eslint-disable-next-line @foxglove/prefer-hash-private + private bar = 1; // eslint-disable-line @lichtblick/prefer-hash-private + private static baz = 1; // eslint-disable-line @lichtblick/prefer-hash-private + // eslint-disable-next-line @lichtblick/prefer-hash-private private foo() { this.bar = 2; } - // eslint-disable-next-line @foxglove/prefer-hash-private + // eslint-disable-next-line @lichtblick/prefer-hash-private private static getBaz() { this.baz = 3; void this.baz; diff --git a/package.json b/package.json index f85c0c3ae3..f8292ebf1b 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "@babel/plugin-proposal-explicit-resource-management": "7.24.7", "@babel/preset-env": "7.25.3", "@babel/preset-typescript": "7.24.7", - "@foxglove/eslint-plugin": "1.0.0", - "@foxglove/eslint-plugin-studio": "workspace:*", "@foxglove/tsconfig": "2.0.0", + "@lichtblick/eslint-plugin": "1.0.1", + "@lichtblick/eslint-plugin-suite": "workspace:*", "@octokit/rest": "20.0.2", "@storybook/addon-actions": "7.6.10", "@storybook/addon-essentials": "7.6.10", diff --git a/packages/@types/cytoscape-dagre/index.d.ts b/packages/@types/cytoscape-dagre/index.d.ts index f7a42d2cd7..6be09757bf 100644 --- a/packages/@types/cytoscape-dagre/index.d.ts +++ b/packages/@types/cytoscape-dagre/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/foxglove__roslibjs/index.d.ts b/packages/@types/foxglove__roslibjs/index.d.ts index 481bf66913..876e8786b4 100644 --- a/packages/@types/foxglove__roslibjs/index.d.ts +++ b/packages/@types/foxglove__roslibjs/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/foxglove__web/index.d.ts b/packages/@types/foxglove__web/index.d.ts index 101d60453b..a67f61a36d 100644 --- a/packages/@types/foxglove__web/index.d.ts +++ b/packages/@types/foxglove__web/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/memoize-weak/index.d.ts b/packages/@types/memoize-weak/index.d.ts index 3ba1d3bbb8..d03f617777 100644 --- a/packages/@types/memoize-weak/index.d.ts +++ b/packages/@types/memoize-weak/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/protobufjs/index.d.ts b/packages/@types/protobufjs/index.d.ts index 19f14e55d2..33e191cc43 100644 --- a/packages/@types/protobufjs/index.d.ts +++ b/packages/@types/protobufjs/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/react-hover-observer/index.d.ts b/packages/@types/react-hover-observer/index.d.ts index 48d6837cde..991c3982f5 100644 --- a/packages/@types/react-hover-observer/index.d.ts +++ b/packages/@types/react-hover-observer/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/@types/text-metrics/index.d.ts b/packages/@types/text-metrics/index.d.ts index 809218297b..054a67edea 100644 --- a/packages/@types/text-metrics/index.d.ts +++ b/packages/@types/text-metrics/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/comlink-transfer-handlers/src/abortSignalTransferHandler.ts b/packages/comlink-transfer-handlers/src/abortSignalTransferHandler.ts index 3a43230f3a..8f36c05569 100644 --- a/packages/comlink-transfer-handlers/src/abortSignalTransferHandler.ts +++ b/packages/comlink-transfer-handlers/src/abortSignalTransferHandler.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/comlink-transfer-handlers/src/index.ts b/packages/comlink-transfer-handlers/src/index.ts index a29dba16bc..e8fe22fd36 100644 --- a/packages/comlink-transfer-handlers/src/index.ts +++ b/packages/comlink-transfer-handlers/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/Condvar.test.ts b/packages/den/async/Condvar.test.ts index 651af878b1..beb6b861f2 100644 --- a/packages/den/async/Condvar.test.ts +++ b/packages/den/async/Condvar.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/Condvar.ts b/packages/den/async/Condvar.ts index 603a55f217..f1fab4dfeb 100644 --- a/packages/den/async/Condvar.ts +++ b/packages/den/async/Condvar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/LazilyInitialized.test.ts b/packages/den/async/LazilyInitialized.test.ts index 296c8196c1..36c3391b50 100644 --- a/packages/den/async/LazilyInitialized.test.ts +++ b/packages/den/async/LazilyInitialized.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/LazilyInitialized.ts b/packages/den/async/LazilyInitialized.ts index d53fa17599..6bc2e4852c 100644 --- a/packages/den/async/LazilyInitialized.ts +++ b/packages/den/async/LazilyInitialized.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/MutexLocked.ts b/packages/den/async/MutexLocked.ts index f95db88c6b..acc799c4f1 100644 --- a/packages/den/async/MutexLocked.ts +++ b/packages/den/async/MutexLocked.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/debouncePromise.test.ts b/packages/den/async/debouncePromise.test.ts index e38e992fd9..111e655937 100644 --- a/packages/den/async/debouncePromise.test.ts +++ b/packages/den/async/debouncePromise.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/debouncePromise.ts b/packages/den/async/debouncePromise.ts index 01291c10e7..8dc70e3345 100644 --- a/packages/den/async/debouncePromise.ts +++ b/packages/den/async/debouncePromise.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/index.ts b/packages/den/async/index.ts index 1018a0cedd..4ee4f40de8 100644 --- a/packages/den/async/index.ts +++ b/packages/den/async/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/promiseTimeout.test.ts b/packages/den/async/promiseTimeout.test.ts index 95de3a769b..fb2c7f79db 100644 --- a/packages/den/async/promiseTimeout.test.ts +++ b/packages/den/async/promiseTimeout.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/promiseTimeout.ts b/packages/den/async/promiseTimeout.ts index 6f2cd896cd..7ea76d0831 100644 --- a/packages/den/async/promiseTimeout.ts +++ b/packages/den/async/promiseTimeout.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/async/signal.ts b/packages/den/async/signal.ts index 9e4947968d..07d2fc3c2b 100644 --- a/packages/den/async/signal.ts +++ b/packages/den/async/signal.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/ArrayMap.test.ts b/packages/den/collection/ArrayMap.test.ts index 1023fb17a0..730c262cc5 100644 --- a/packages/den/collection/ArrayMap.test.ts +++ b/packages/den/collection/ArrayMap.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/ArrayMap.ts b/packages/den/collection/ArrayMap.ts index d206fd0f6e..34016bcf32 100644 --- a/packages/den/collection/ArrayMap.ts +++ b/packages/den/collection/ArrayMap.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/MultiMap.test.ts b/packages/den/collection/MultiMap.test.ts index 835b509e87..29c4507341 100644 --- a/packages/den/collection/MultiMap.test.ts +++ b/packages/den/collection/MultiMap.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/MultiMap.ts b/packages/den/collection/MultiMap.ts index 3c42cc5fc5..0e417c058e 100644 --- a/packages/den/collection/MultiMap.ts +++ b/packages/den/collection/MultiMap.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/ObjectPool.test.ts b/packages/den/collection/ObjectPool.test.ts index 1d43513de8..0b15c424f1 100644 --- a/packages/den/collection/ObjectPool.test.ts +++ b/packages/den/collection/ObjectPool.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/ObjectPool.ts b/packages/den/collection/ObjectPool.ts index 8ccb3651b2..fc42450fcd 100644 --- a/packages/den/collection/ObjectPool.ts +++ b/packages/den/collection/ObjectPool.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/VecQueue.test.ts b/packages/den/collection/VecQueue.test.ts index 5df23a42c3..df0b338dd8 100644 --- a/packages/den/collection/VecQueue.test.ts +++ b/packages/den/collection/VecQueue.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/VecQueue.ts b/packages/den/collection/VecQueue.ts index 3453a109a1..c5e10cfa1f 100644 --- a/packages/den/collection/VecQueue.ts +++ b/packages/den/collection/VecQueue.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/binarySearch.test.ts b/packages/den/collection/binarySearch.test.ts index 437477b1d8..dd26f6e65c 100644 --- a/packages/den/collection/binarySearch.test.ts +++ b/packages/den/collection/binarySearch.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/binarySearch.ts b/packages/den/collection/binarySearch.ts index 6ac4e14508..83eab9e890 100644 --- a/packages/den/collection/binarySearch.ts +++ b/packages/den/collection/binarySearch.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/filterMap.test.ts b/packages/den/collection/filterMap.test.ts index 604b501aea..bfe774945b 100644 --- a/packages/den/collection/filterMap.test.ts +++ b/packages/den/collection/filterMap.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/filterMap.ts b/packages/den/collection/filterMap.ts index a8f87ca5e7..573fc4749b 100644 --- a/packages/den/collection/filterMap.ts +++ b/packages/den/collection/filterMap.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/index.ts b/packages/den/collection/index.ts index 822eb090b0..61b33ac2df 100644 --- a/packages/den/collection/index.ts +++ b/packages/den/collection/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/minIndexBy.test.ts b/packages/den/collection/minIndexBy.test.ts index b17d9022af..75eb2f4686 100644 --- a/packages/den/collection/minIndexBy.test.ts +++ b/packages/den/collection/minIndexBy.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/collection/minIndexBy.ts b/packages/den/collection/minIndexBy.ts index 28b6a7cc36..c8fabfc5f2 100644 --- a/packages/den/collection/minIndexBy.ts +++ b/packages/den/collection/minIndexBy.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/disposable/defer.test.ts b/packages/den/disposable/defer.test.ts index e3956687b5..50e81d9147 100644 --- a/packages/den/disposable/defer.test.ts +++ b/packages/den/disposable/defer.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/disposable/defer.ts b/packages/den/disposable/defer.ts index f0a42650e7..4e9e5adc05 100644 --- a/packages/den/disposable/defer.ts +++ b/packages/den/disposable/defer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/disposable/index.ts b/packages/den/disposable/index.ts index 902245a299..40dd820880 100644 --- a/packages/den/disposable/index.ts +++ b/packages/den/disposable/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/format/formatByteSize.test.ts b/packages/den/format/formatByteSize.test.ts index 80a4275b88..bce15237a0 100644 --- a/packages/den/format/formatByteSize.test.ts +++ b/packages/den/format/formatByteSize.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/format/formatByteSize.ts b/packages/den/format/formatByteSize.ts index 7bf337fade..956a655883 100644 --- a/packages/den/format/formatByteSize.ts +++ b/packages/den/format/formatByteSize.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/format/index.ts b/packages/den/format/index.ts index 34d20322e6..235cdb62e5 100644 --- a/packages/den/format/index.ts +++ b/packages/den/format/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/image/CameraInfo.ts b/packages/den/image/CameraInfo.ts index e455cf08a7..a3fe33c356 100644 --- a/packages/den/image/CameraInfo.ts +++ b/packages/den/image/CameraInfo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/image/PinholeCameraModel.test.ts b/packages/den/image/PinholeCameraModel.test.ts index 5dd084037f..40737382af 100644 --- a/packages/den/image/PinholeCameraModel.test.ts +++ b/packages/den/image/PinholeCameraModel.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/image/PinholeCameraModel.ts b/packages/den/image/PinholeCameraModel.ts index af93ee5531..2369ad8595 100644 --- a/packages/den/image/PinholeCameraModel.ts +++ b/packages/den/image/PinholeCameraModel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/image/decodings.test.ts b/packages/den/image/decodings.test.ts index 3d18a7c4ba..a7ba1a4205 100644 --- a/packages/den/image/decodings.test.ts +++ b/packages/den/image/decodings.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/image/decodings.ts b/packages/den/image/decodings.ts index 80e867a91a..b8347c0167 100644 --- a/packages/den/image/decodings.ts +++ b/packages/den/image/decodings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -209,7 +212,7 @@ export function decodeFloat1c( width: number, height: number, step: number, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters is_bigendian: boolean, output: Uint8ClampedArray, ): void { @@ -260,7 +263,7 @@ export function decodeMono16( width: number, height: number, step: number, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters is_bigendian: boolean, output: Uint8ClampedArray, options?: { diff --git a/packages/den/image/index.ts b/packages/den/image/index.ts index 2412db23d1..23b2fb73a8 100644 --- a/packages/den/image/index.ts +++ b/packages/den/image/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/math/index.ts b/packages/den/math/index.ts index 3a3d34656c..e2aa633a43 100644 --- a/packages/den/math/index.ts +++ b/packages/den/math/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/math/utils.ts b/packages/den/math/utils.ts index e3ea7b373c..1a86f318d3 100644 --- a/packages/den/math/utils.ts +++ b/packages/den/math/utils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/monads/index.ts b/packages/den/monads/index.ts index ef81abbdf0..ad64745179 100644 --- a/packages/den/monads/index.ts +++ b/packages/den/monads/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/monads/unwrap.test.ts b/packages/den/monads/unwrap.test.ts index 7e8f2fb015..dc81d18484 100644 --- a/packages/den/monads/unwrap.test.ts +++ b/packages/den/monads/unwrap.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/monads/unwrap.ts b/packages/den/monads/unwrap.ts index 8b78a1661e..e0d8e36165 100644 --- a/packages/den/monads/unwrap.ts +++ b/packages/den/monads/unwrap.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/records/index.ts b/packages/den/records/index.ts index 3d1c1e1038..a4f6f76bd2 100644 --- a/packages/den/records/index.ts +++ b/packages/den/records/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/records/pickFields.test.ts b/packages/den/records/pickFields.test.ts index fc4e6860ca..ac98259292 100644 --- a/packages/den/records/pickFields.test.ts +++ b/packages/den/records/pickFields.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/records/pickFields.ts b/packages/den/records/pickFields.ts index 01ae4bf9f0..861986062e 100644 --- a/packages/den/records/pickFields.ts +++ b/packages/den/records/pickFields.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/testing/index.ts b/packages/den/testing/index.ts index bac041dace..da53a4d404 100644 --- a/packages/den/testing/index.ts +++ b/packages/den/testing/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/testing/makeComlinkWorkerMock.ts b/packages/den/testing/makeComlinkWorkerMock.ts index d1580c42c9..fdedb97f5d 100644 --- a/packages/den/testing/makeComlinkWorkerMock.ts +++ b/packages/den/testing/makeComlinkWorkerMock.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/urdf/index.ts b/packages/den/urdf/index.ts index 0c1b26c902..491d84b565 100644 --- a/packages/den/urdf/index.ts +++ b/packages/den/urdf/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/urdf/parser.test.ts b/packages/den/urdf/parser.test.ts index 03ed67c127..73d71f2adf 100644 --- a/packages/den/urdf/parser.test.ts +++ b/packages/den/urdf/parser.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/urdf/parser.ts b/packages/den/urdf/parser.ts index 76b5a118dd..6d79367629 100644 --- a/packages/den/urdf/parser.ts +++ b/packages/den/urdf/parser.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/urdf/types.ts b/packages/den/urdf/types.ts index b1355162e3..55a4624742 100644 --- a/packages/den/urdf/types.ts +++ b/packages/den/urdf/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/worker/ComlinkWrap.ts b/packages/den/worker/ComlinkWrap.ts index 76dd3b202b..23d85244f6 100644 --- a/packages/den/worker/ComlinkWrap.ts +++ b/packages/den/worker/ComlinkWrap.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/den/worker/index.ts b/packages/den/worker/index.ts index e2ddc50250..f8be7b53bb 100644 --- a/packages/den/worker/index.ts +++ b/packages/den/worker/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/fixture/file.ts b/packages/eslint-plugin-suite/fixture/file.ts similarity index 60% rename from packages/eslint-plugin-studio/fixture/file.ts rename to packages/eslint-plugin-suite/fixture/file.ts index 71e1e7d102..eac020b8af 100644 --- a/packages/eslint-plugin-studio/fixture/file.ts +++ b/packages/eslint-plugin-suite/fixture/file.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/fixture/tsconfig.json b/packages/eslint-plugin-suite/fixture/tsconfig.json similarity index 100% rename from packages/eslint-plugin-studio/fixture/tsconfig.json rename to packages/eslint-plugin-suite/fixture/tsconfig.json diff --git a/packages/eslint-plugin-studio/index.js b/packages/eslint-plugin-suite/index.js similarity index 54% rename from packages/eslint-plugin-studio/index.js rename to packages/eslint-plugin-suite/index.js index 8b91aa3efe..7f16c86b99 100644 --- a/packages/eslint-plugin-studio/index.js +++ b/packages/eslint-plugin-suite/index.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,12 @@ module.exports = { configs: { all: { - plugins: ["@foxglove/studio"], + plugins: ["@lichtblick/suite"], rules: { - "@foxglove/studio/link-target": "error", - "@foxglove/studio/lodash-ramda-imports": "error", - "@foxglove/studio/ramda-usage": "error", - "@foxglove/studio/no-map-type-argument": "error", + "@lichtblick/suite/link-target": "error", + "@lichtblick/suite/lodash-ramda-imports": "error", + "@lichtblick/suite/ramda-usage": "error", + "@lichtblick/suite/no-map-type-argument": "error", }, }, }, diff --git a/packages/eslint-plugin-studio/jest.config.json b/packages/eslint-plugin-suite/jest.config.json similarity index 100% rename from packages/eslint-plugin-studio/jest.config.json rename to packages/eslint-plugin-suite/jest.config.json diff --git a/packages/eslint-plugin-studio/link-target.js b/packages/eslint-plugin-suite/link-target.js similarity index 86% rename from packages/eslint-plugin-studio/link-target.js rename to packages/eslint-plugin-suite/link-target.js index 639e46723b..596013b966 100644 --- a/packages/eslint-plugin-studio/link-target.js +++ b/packages/eslint-plugin-suite/link-target.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/lodash-ramda-imports.js b/packages/eslint-plugin-suite/lodash-ramda-imports.js similarity index 95% rename from packages/eslint-plugin-studio/lodash-ramda-imports.js rename to packages/eslint-plugin-suite/lodash-ramda-imports.js index 9eb83c186d..27d7d9ef48 100644 --- a/packages/eslint-plugin-studio/lodash-ramda-imports.js +++ b/packages/eslint-plugin-suite/lodash-ramda-imports.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/lodash-ramda-imports.test.ts b/packages/eslint-plugin-suite/lodash-ramda-imports.test.ts similarity index 94% rename from packages/eslint-plugin-studio/lodash-ramda-imports.test.ts rename to packages/eslint-plugin-suite/lodash-ramda-imports.test.ts index a363bc48a0..af0449aeac 100644 --- a/packages/eslint-plugin-studio/lodash-ramda-imports.test.ts +++ b/packages/eslint-plugin-suite/lodash-ramda-imports.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/no-map-type-argument.js b/packages/eslint-plugin-suite/no-map-type-argument.js similarity index 94% rename from packages/eslint-plugin-studio/no-map-type-argument.js rename to packages/eslint-plugin-suite/no-map-type-argument.js index 84d7c1448e..dfb6b56de3 100644 --- a/packages/eslint-plugin-studio/no-map-type-argument.js +++ b/packages/eslint-plugin-suite/no-map-type-argument.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/no-map-type-argument.test.ts b/packages/eslint-plugin-suite/no-map-type-argument.test.ts similarity index 89% rename from packages/eslint-plugin-studio/no-map-type-argument.test.ts rename to packages/eslint-plugin-suite/no-map-type-argument.test.ts index b2792a3546..407b5cf9be 100644 --- a/packages/eslint-plugin-studio/no-map-type-argument.test.ts +++ b/packages/eslint-plugin-suite/no-map-type-argument.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/package.json b/packages/eslint-plugin-suite/package.json similarity index 91% rename from packages/eslint-plugin-studio/package.json rename to packages/eslint-plugin-suite/package.json index 2c70f91582..6819535993 100644 --- a/packages/eslint-plugin-studio/package.json +++ b/packages/eslint-plugin-suite/package.json @@ -1,5 +1,5 @@ { - "name": "@foxglove/eslint-plugin-studio", + "name": "@lichtblick/eslint-plugin-suite", "license": "MPL-2.0", "private": true, "repository": { diff --git a/packages/eslint-plugin-studio/ramda-usage.js b/packages/eslint-plugin-suite/ramda-usage.js similarity index 96% rename from packages/eslint-plugin-studio/ramda-usage.js rename to packages/eslint-plugin-suite/ramda-usage.js index 04b9183683..810dbfc015 100644 --- a/packages/eslint-plugin-studio/ramda-usage.js +++ b/packages/eslint-plugin-suite/ramda-usage.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/ramda-usage.test.ts b/packages/eslint-plugin-suite/ramda-usage.test.ts similarity index 97% rename from packages/eslint-plugin-studio/ramda-usage.test.ts rename to packages/eslint-plugin-suite/ramda-usage.test.ts index edfc5ef59e..2b374f27d5 100644 --- a/packages/eslint-plugin-studio/ramda-usage.test.ts +++ b/packages/eslint-plugin-suite/ramda-usage.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/eslint-plugin-studio/tsconfig.json b/packages/eslint-plugin-suite/tsconfig.json similarity index 100% rename from packages/eslint-plugin-studio/tsconfig.json rename to packages/eslint-plugin-suite/tsconfig.json diff --git a/packages/hooks/src/index.ts b/packages/hooks/src/index.ts index 696cb675d5..1139819991 100644 --- a/packages/hooks/src/index.ts +++ b/packages/hooks/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/selectWithUnstableIdentityWarning.ts b/packages/hooks/src/selectWithUnstableIdentityWarning.ts index 5b0489cfba..45fe58f105 100644 --- a/packages/hooks/src/selectWithUnstableIdentityWarning.ts +++ b/packages/hooks/src/selectWithUnstableIdentityWarning.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useChangeDetector.test.ts b/packages/hooks/src/useChangeDetector.test.ts index 025d409caa..2fa618fe5d 100644 --- a/packages/hooks/src/useChangeDetector.test.ts +++ b/packages/hooks/src/useChangeDetector.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useChangeDetector.ts b/packages/hooks/src/useChangeDetector.ts index 1f7b46b807..fdbf9835ca 100644 --- a/packages/hooks/src/useChangeDetector.ts +++ b/packages/hooks/src/useChangeDetector.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useCrash.test.ts b/packages/hooks/src/useCrash.test.ts index 792fb49607..c6ae4e2516 100644 --- a/packages/hooks/src/useCrash.test.ts +++ b/packages/hooks/src/useCrash.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useCrash.ts b/packages/hooks/src/useCrash.ts index d4532cbf88..9d275d69d8 100644 --- a/packages/hooks/src/useCrash.ts +++ b/packages/hooks/src/useCrash.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useDeepMemo.test.ts b/packages/hooks/src/useDeepMemo.test.ts index a9bea99774..3f83ced893 100644 --- a/packages/hooks/src/useDeepMemo.test.ts +++ b/packages/hooks/src/useDeepMemo.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useDeepMemo.ts b/packages/hooks/src/useDeepMemo.ts index 25555a5936..dde0c7e9f1 100644 --- a/packages/hooks/src/useDeepMemo.ts +++ b/packages/hooks/src/useDeepMemo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useGuaranteedContext.ts b/packages/hooks/src/useGuaranteedContext.ts index b8a9402a2d..0783261d1b 100644 --- a/packages/hooks/src/useGuaranteedContext.ts +++ b/packages/hooks/src/useGuaranteedContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useMemoryInfo.ts b/packages/hooks/src/useMemoryInfo.ts index 1eaddd95bc..9837444ee7 100644 --- a/packages/hooks/src/useMemoryInfo.ts +++ b/packages/hooks/src/useMemoryInfo.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ // foxglove-depcheck-used: @types/foxglove__web -import Logger from "@lichtblick/log"; import { useEffect, useState } from "react"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); type UseMemoryInfoOptions = { diff --git a/packages/hooks/src/useMustNotChange.test.ts b/packages/hooks/src/useMustNotChange.test.ts index 028dc58812..f2e3f36ff0 100644 --- a/packages/hooks/src/useMustNotChange.test.ts +++ b/packages/hooks/src/useMustNotChange.test.ts @@ -1,11 +1,15 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { renderHook } from "@testing-library/react"; +import Logger from "@lichtblick/log"; + import { useMustNotChangeImpl } from "./useMustNotChange"; describe("useMustNotChange", () => { diff --git a/packages/hooks/src/useMustNotChange.ts b/packages/hooks/src/useMustNotChange.ts index c6d72af0ca..8427b5fb92 100644 --- a/packages/hooks/src/useMustNotChange.ts +++ b/packages/hooks/src/useMustNotChange.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { useRef } from "react"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); const useMustNotChangeImpl = (value: unknown): void => { diff --git a/packages/hooks/src/useRethrow.test.ts b/packages/hooks/src/useRethrow.test.ts index 4ae6b2a048..faf3d9cd30 100644 --- a/packages/hooks/src/useRethrow.test.ts +++ b/packages/hooks/src/useRethrow.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useRethrow.ts b/packages/hooks/src/useRethrow.ts index 2fb0f3b734..740a7086f5 100644 --- a/packages/hooks/src/useRethrow.ts +++ b/packages/hooks/src/useRethrow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useSessionStorageValue.ts b/packages/hooks/src/useSessionStorageValue.ts index a7224cfaee..1ab98fe602 100644 --- a/packages/hooks/src/useSessionStorageValue.ts +++ b/packages/hooks/src/useSessionStorageValue.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useShallowMemo.test.ts b/packages/hooks/src/useShallowMemo.test.ts index cc71ae4588..aae3095cd6 100644 --- a/packages/hooks/src/useShallowMemo.test.ts +++ b/packages/hooks/src/useShallowMemo.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,9 +15,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { useShallowMemo } from "@lichtblick/hooks"; import { renderHook } from "@testing-library/react"; +import { useShallowMemo } from "@lichtblick/hooks"; + describe("useShallowMemo", () => { it("returns original object when shallowly equal", () => { { diff --git a/packages/hooks/src/useShallowMemo.ts b/packages/hooks/src/useShallowMemo.ts index 1206381173..24e388726b 100644 --- a/packages/hooks/src/useShallowMemo.ts +++ b/packages/hooks/src/useShallowMemo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useSynchronousMountedState.test.tsx b/packages/hooks/src/useSynchronousMountedState.test.tsx index 7e343dc2be..9efd6b8868 100644 --- a/packages/hooks/src/useSynchronousMountedState.test.tsx +++ b/packages/hooks/src/useSynchronousMountedState.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useSynchronousMountedState.ts b/packages/hooks/src/useSynchronousMountedState.ts index f51b1508c8..3a420abe75 100644 --- a/packages/hooks/src/useSynchronousMountedState.ts +++ b/packages/hooks/src/useSynchronousMountedState.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useValueChangedDebugLog.test.ts b/packages/hooks/src/useValueChangedDebugLog.test.ts index efad126e95..4296247f03 100644 --- a/packages/hooks/src/useValueChangedDebugLog.test.ts +++ b/packages/hooks/src/useValueChangedDebugLog.test.ts @@ -1,11 +1,15 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { renderHook } from "@testing-library/react"; +import Logger from "@lichtblick/log"; + import { default as useValueChangedDebugLog } from "./useValueChangedDebugLog"; describe("useValueChangeDebugLog", () => { diff --git a/packages/hooks/src/useValueChangedDebugLog.ts b/packages/hooks/src/useValueChangedDebugLog.ts index b26de4538f..eefb274b49 100644 --- a/packages/hooks/src/useValueChangedDebugLog.ts +++ b/packages/hooks/src/useValueChangedDebugLog.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { useRef, useLayoutEffect } from "react"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); const noOpImpl = () => {}; diff --git a/packages/hooks/src/useVisibilityState.test.ts b/packages/hooks/src/useVisibilityState.test.ts index 001a10030d..2bacb25641 100644 --- a/packages/hooks/src/useVisibilityState.test.ts +++ b/packages/hooks/src/useVisibilityState.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useVisibilityState.ts b/packages/hooks/src/useVisibilityState.ts index e9d5eeb26e..6c333b7633 100644 --- a/packages/hooks/src/useVisibilityState.ts +++ b/packages/hooks/src/useVisibilityState.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/hooks/src/useWarnImmediateReRender.ts b/packages/hooks/src/useWarnImmediateReRender.ts index 5e9b9482ba..907a4f142a 100644 --- a/packages/hooks/src/useWarnImmediateReRender.ts +++ b/packages/hooks/src/useWarnImmediateReRender.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; import { useLayoutEffect, useRef } from "react"; +import Log from "@lichtblick/log"; + const log = Log.getLogger(__filename); // useWarnImmediateReRender will warn if the component re-renders before the next animation frame diff --git a/packages/hooks/test/setup.ts b/packages/hooks/test/setup.ts index d1f7c68961..226ff0c7c3 100644 --- a/packages/hooks/test/setup.ts +++ b/packages/hooks/test/setup.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/log/src/index.ts b/packages/log/src/index.ts index 486433a312..28cc401c39 100644 --- a/packages/log/src/index.ts +++ b/packages/log/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/TempBuffer.ts b/packages/mcap-support/src/TempBuffer.ts index 0b5552212a..e4ba316bf5 100644 --- a/packages/mcap-support/src/TempBuffer.ts +++ b/packages/mcap-support/src/TempBuffer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/decompressHandlers.ts b/packages/mcap-support/src/decompressHandlers.ts index 34211032ea..033a3c1af3 100644 --- a/packages/mcap-support/src/decompressHandlers.ts +++ b/packages/mcap-support/src/decompressHandlers.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/fixtures/byte-vector.ts b/packages/mcap-support/src/fixtures/byte-vector.ts index 4b7e56030a..0e7ba0b3e8 100644 --- a/packages/mcap-support/src/fixtures/byte-vector.ts +++ b/packages/mcap-support/src/fixtures/byte-vector.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/index.ts b/packages/mcap-support/src/index.ts index 1669abf192..76d93cadcd 100644 --- a/packages/mcap-support/src/index.ts +++ b/packages/mcap-support/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/parseChannel.test.ts b/packages/mcap-support/src/parseChannel.test.ts index 1dc23d61b4..5c3a18fa63 100644 --- a/packages/mcap-support/src/parseChannel.test.ts +++ b/packages/mcap-support/src/parseChannel.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/parseChannel.ts b/packages/mcap-support/src/parseChannel.ts index ff637339fd..f666080d22 100644 --- a/packages/mcap-support/src/parseChannel.ts +++ b/packages/mcap-support/src/parseChannel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/parseFlatbufferSchema.test.ts b/packages/mcap-support/src/parseFlatbufferSchema.test.ts index d5fb909a06..944bcec380 100644 --- a/packages/mcap-support/src/parseFlatbufferSchema.test.ts +++ b/packages/mcap-support/src/parseFlatbufferSchema.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/parseFlatbufferSchema.ts b/packages/mcap-support/src/parseFlatbufferSchema.ts index 666f99e9f1..25cc406a28 100644 --- a/packages/mcap-support/src/parseFlatbufferSchema.ts +++ b/packages/mcap-support/src/parseFlatbufferSchema.ts @@ -1,12 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessageDefinitionField } from "@foxglove/message-definition"; import { ByteBuffer } from "flatbuffers"; import { BaseType, Schema, SchemaT, FieldT, Parser, Table } from "flatbuffers_reflection"; -import { MessageDefinitionField } from "@foxglove/message-definition"; - import { MessageDefinitionMap } from "./types"; function typeForSimpleField(type: BaseType): string { diff --git a/packages/mcap-support/src/parseJsonSchema.test.ts b/packages/mcap-support/src/parseJsonSchema.test.ts index 0164bbb691..17d8644a89 100644 --- a/packages/mcap-support/src/parseJsonSchema.test.ts +++ b/packages/mcap-support/src/parseJsonSchema.test.ts @@ -1,10 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as protobufjs from "protobufjs"; - import { foxgloveMessageSchemas, generateJsonSchema } from "@foxglove/schemas/internal"; +import * as protobufjs from "protobufjs"; import { parseJsonSchema } from "./parseJsonSchema"; diff --git a/packages/mcap-support/src/parseJsonSchema.ts b/packages/mcap-support/src/parseJsonSchema.ts index a79375a6ad..fa9b631827 100644 --- a/packages/mcap-support/src/parseJsonSchema.ts +++ b/packages/mcap-support/src/parseJsonSchema.ts @@ -1,10 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as base64 from "@protobufjs/base64"; - import { MessageDefinitionField } from "@foxglove/message-definition"; +import * as base64 from "@protobufjs/base64"; import { MessageDefinitionMap } from "./types"; diff --git a/packages/mcap-support/src/parseProtobufSchema.test.ts b/packages/mcap-support/src/parseProtobufSchema.test.ts index d322defeb4..e979d9ebec 100644 --- a/packages/mcap-support/src/parseProtobufSchema.test.ts +++ b/packages/mcap-support/src/parseProtobufSchema.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/parseProtobufSchema.ts b/packages/mcap-support/src/parseProtobufSchema.ts index e886f33206..c502e876e3 100644 --- a/packages/mcap-support/src/parseProtobufSchema.ts +++ b/packages/mcap-support/src/parseProtobufSchema.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/mcap-support/src/protobufDefinitionsToDatatypes.ts b/packages/mcap-support/src/protobufDefinitionsToDatatypes.ts index 515fab7efa..39aaeed4a2 100644 --- a/packages/mcap-support/src/protobufDefinitionsToDatatypes.ts +++ b/packages/mcap-support/src/protobufDefinitionsToDatatypes.ts @@ -1,9 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import protobufjs from "protobufjs"; - import { MessageDefinitionField } from "@foxglove/message-definition"; +import protobufjs from "protobufjs"; import { MessageDefinitionMap } from "./types"; diff --git a/packages/mcap-support/src/types.ts b/packages/mcap-support/src/types.ts index 8067d641bf..3f6d1e5075 100644 --- a/packages/mcap-support/src/types.ts +++ b/packages/mcap-support/src/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/message-path/src/index.ts b/packages/message-path/src/index.ts index 7cf53ee82e..ea5a1591a1 100644 --- a/packages/message-path/src/index.ts +++ b/packages/message-path/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/message-path/src/parseMessagePath.test.ts b/packages/message-path/src/parseMessagePath.test.ts index 437a7a117b..43dc23e918 100644 --- a/packages/message-path/src/parseMessagePath.test.ts +++ b/packages/message-path/src/parseMessagePath.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/message-path/src/parseMessagePath.ts b/packages/message-path/src/parseMessagePath.ts index 1cedaef144..1a20bbf447 100644 --- a/packages/message-path/src/parseMessagePath.ts +++ b/packages/message-path/src/parseMessagePath.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/message-path/src/types.ts b/packages/message-path/src/types.ts index 35d671c5d1..a18586d3eb 100644 --- a/packages/message-path/src/types.ts +++ b/packages/message-path/src/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/message-path/src/typings/extensions.ts b/packages/message-path/src/typings/extensions.ts index e86912ab19..68dceefc2b 100644 --- a/packages/message-path/src/typings/extensions.ts +++ b/packages/message-path/src/typings/extensions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/WebpackArgv.ts b/packages/suite-base/WebpackArgv.ts index a4d16d9121..17aa10d042 100644 --- a/packages/suite-base/WebpackArgv.ts +++ b/packages/suite-base/WebpackArgv.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/App.tsx b/packages/suite-base/src/App.tsx index ec34acf7ac..da831af74b 100644 --- a/packages/suite-base/src/App.tsx +++ b/packages/suite-base/src/App.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Fragment, Suspense, useEffect, useMemo } from "react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import { IdbLayoutStorage } from "@lichtblick/suite-base/IdbLayoutStorage"; import GlobalCss from "@lichtblick/suite-base/components/GlobalCss"; import LayoutStorageContext from "@lichtblick/suite-base/context/LayoutStorageContext"; @@ -13,9 +20,6 @@ import { StudioLogsSettingsProvider } from "@lichtblick/suite-base/providers/Stu import TimelineInteractionStateProvider from "@lichtblick/suite-base/providers/TimelineInteractionStateProvider"; import UserProfileLocalStorageProvider from "@lichtblick/suite-base/providers/UserProfileLocalStorageProvider"; import { LayoutLoader } from "@lichtblick/suite-base/services/ILayoutLoader"; -import { Fragment, Suspense, useEffect, useMemo } from "react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; import Workspace from "./Workspace"; import { CustomWindowControlsProps } from "./components/AppBar/CustomWindowControls"; diff --git a/packages/suite-base/src/AppSetting.ts b/packages/suite-base/src/AppSetting.ts index 92f35042a1..5d6f12a3a4 100644 --- a/packages/suite-base/src/AppSetting.ts +++ b/packages/suite-base/src/AppSetting.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/IdbLayoutStorage.ts b/packages/suite-base/src/IdbLayoutStorage.ts index e398233be6..d6a484a713 100644 --- a/packages/suite-base/src/IdbLayoutStorage.ts +++ b/packages/suite-base/src/IdbLayoutStorage.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as IDB from "idb/with-async-ittr"; + import Log from "@lichtblick/log"; import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { ILayoutStorage, Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; import { migrateLayout } from "@lichtblick/suite-base/services/migrateLayout"; -import * as IDB from "idb/with-async-ittr"; const log = Log.getLogger(__filename); diff --git a/packages/suite-base/src/OsContext.ts b/packages/suite-base/src/OsContext.ts index 19eb62cd1d..5d51646847 100644 --- a/packages/suite-base/src/OsContext.ts +++ b/packages/suite-base/src/OsContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/OsContextSingleton.ts b/packages/suite-base/src/OsContextSingleton.ts index bb52381290..8865ad2af6 100644 --- a/packages/suite-base/src/OsContextSingleton.ts +++ b/packages/suite-base/src/OsContextSingleton.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/PanelAPI/index.ts b/packages/suite-base/src/PanelAPI/index.ts index c6a45009a0..500377bfbf 100644 --- a/packages/suite-base/src/PanelAPI/index.ts +++ b/packages/suite-base/src/PanelAPI/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.test.tsx b/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.test.tsx index bd3374fd2f..19c85d1561 100644 --- a/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.test.tsx +++ b/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,11 +15,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook } from "@testing-library/react"; +import * as _ from "lodash-es"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { SubscribePayload } from "@lichtblick/suite-base/players/types"; import { mockMessage } from "@lichtblick/suite-base/test/mocks/mockMessage"; -import { renderHook } from "@testing-library/react"; -import * as _ from "lodash-es"; import * as PanelAPI from "."; diff --git a/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.ts b/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.ts index 332118b8e1..be15800a4a 100644 --- a/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.ts +++ b/packages/suite-base/src/PanelAPI/useBlocksSubscriptions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import memoizeWeak from "memoize-weak"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { v4 as uuidv4 } from "uuid"; + import { Immutable } from "@lichtblick/suite"; import { MessagePipelineContext, @@ -21,9 +28,6 @@ import { MessageBlock as PlayerMessageBlock, SubscribePayload, } from "@lichtblick/suite-base/players/types"; -import memoizeWeak from "memoize-weak"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import { v4 as uuidv4 } from "uuid"; export type MessageBlock = Immutable<{ [topicName: string]: MessageEvent[]; diff --git a/packages/suite-base/src/PanelAPI/useConfigById.ts b/packages/suite-base/src/PanelAPI/useConfigById.ts index f4f6997de8..0980c6c9cd 100644 --- a/packages/suite-base/src/PanelAPI/useConfigById.ts +++ b/packages/suite-base/src/PanelAPI/useConfigById.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback } from "react"; +import { DeepPartial } from "ts-essentials"; + import { LayoutState, useCurrentLayoutActions, @@ -9,8 +15,6 @@ import { } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { maybeCast } from "@lichtblick/suite-base/util/maybeCast"; -import { useCallback } from "react"; -import { DeepPartial } from "ts-essentials"; /** * Like `useConfig`, but for a specific panel id. This generally shouldn't be used by panels diff --git a/packages/suite-base/src/PanelAPI/useDataSourceInfo.test.tsx b/packages/suite-base/src/PanelAPI/useDataSourceInfo.test.tsx index 816c6c339e..b64d85a636 100644 --- a/packages/suite-base/src/PanelAPI/useDataSourceInfo.test.tsx +++ b/packages/suite-base/src/PanelAPI/useDataSourceInfo.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,10 +15,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook } from "@testing-library/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { MessageEvent, Topic } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { renderHook } from "@testing-library/react"; import * as PanelAPI from "."; diff --git a/packages/suite-base/src/PanelAPI/useDataSourceInfo.ts b/packages/suite-base/src/PanelAPI/useDataSourceInfo.ts index a4fe90be0b..95acefd06e 100644 --- a/packages/suite-base/src/PanelAPI/useDataSourceInfo.ts +++ b/packages/suite-base/src/PanelAPI/useDataSourceInfo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useMemo } from "react"; + import { Immutable, Time } from "@lichtblick/suite"; import { MessagePipelineContext, @@ -18,7 +23,6 @@ import { } from "@lichtblick/suite-base/components/MessagePipeline"; import { Topic } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { useMemo } from "react"; function selectDatatypes(ctx: MessagePipelineContext) { return ctx.datatypes; diff --git a/packages/suite-base/src/PanelAPI/useMessageReducer.test.tsx b/packages/suite-base/src/PanelAPI/useMessageReducer.test.tsx index 87a7baf0a7..c768ca4ea0 100644 --- a/packages/suite-base/src/PanelAPI/useMessageReducer.test.tsx +++ b/packages/suite-base/src/PanelAPI/useMessageReducer.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,6 +15,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook, act } from "@testing-library/react"; +import { PropsWithChildren, useState } from "react"; + import { MessagePipelineProvider } from "@lichtblick/suite-base/components/MessagePipeline"; import FakePlayer from "@lichtblick/suite-base/components/MessagePipeline/FakePlayer"; import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; @@ -24,8 +30,6 @@ import { } from "@lichtblick/suite-base/players/types"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { renderHook, act } from "@testing-library/react"; -import { PropsWithChildren, useState } from "react"; import * as PanelAPI from "."; diff --git a/packages/suite-base/src/PanelAPI/useMessageReducer.ts b/packages/suite-base/src/PanelAPI/useMessageReducer.ts index c39990669b..7dc3112e71 100644 --- a/packages/suite-base/src/PanelAPI/useMessageReducer.ts +++ b/packages/suite-base/src/PanelAPI/useMessageReducer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { v4 as uuidv4 } from "uuid"; + import { useShallowMemo } from "@lichtblick/hooks"; import Log from "@lichtblick/log"; import { @@ -24,8 +30,6 @@ import { SubscribePayload, SubscriptionPreloadType, } from "@lichtblick/suite-base/players/types"; -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { v4 as uuidv4 } from "uuid"; const log = Log.getLogger(__filename); diff --git a/packages/suite-base/src/PanelAPI/useMessagesByTopic.test.tsx b/packages/suite-base/src/PanelAPI/useMessagesByTopic.test.tsx index 7ee0671d65..81691a5d1c 100644 --- a/packages/suite-base/src/PanelAPI/useMessagesByTopic.test.tsx +++ b/packages/suite-base/src/PanelAPI/useMessagesByTopic.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,9 +15,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook } from "@testing-library/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; -import { renderHook } from "@testing-library/react"; import * as PanelAPI from "."; diff --git a/packages/suite-base/src/PanelAPI/useMessagesByTopic.ts b/packages/suite-base/src/PanelAPI/useMessagesByTopic.ts index e10e6dc3a6..a38d7ad6ef 100644 --- a/packages/suite-base/src/PanelAPI/useMessagesByTopic.ts +++ b/packages/suite-base/src/PanelAPI/useMessagesByTopic.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; +import { useCallback } from "react"; + import { useDeepMemo } from "@lichtblick/hooks"; import { MessageEvent, SubscribePayload } from "@lichtblick/suite-base/players/types"; import concatAndTruncate from "@lichtblick/suite-base/util/concatAndTruncate"; -import * as _ from "lodash-es"; -import { useCallback } from "react"; import { useMessageReducer } from "./useMessageReducer"; diff --git a/packages/suite-base/src/SharedRoot.tsx b/packages/suite-base/src/SharedRoot.tsx index 5dc70862a2..6399e6dce0 100644 --- a/packages/suite-base/src/SharedRoot.tsx +++ b/packages/suite-base/src/SharedRoot.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/StudioApp.tsx b/packages/suite-base/src/StudioApp.tsx index 28e63305cf..7cbd8d837c 100644 --- a/packages/suite-base/src/StudioApp.tsx +++ b/packages/suite-base/src/StudioApp.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Fragment, Suspense, useEffect, useMemo } from "react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import { IdbLayoutStorage } from "@lichtblick/suite-base/IdbLayoutStorage"; import LayoutStorageContext from "@lichtblick/suite-base/context/LayoutStorageContext"; import NativeAppMenuContext from "@lichtblick/suite-base/context/NativeAppMenuContext"; @@ -13,9 +20,6 @@ import ProblemsContextProvider from "@lichtblick/suite-base/providers/ProblemsCo import { StudioLogsSettingsProvider } from "@lichtblick/suite-base/providers/StudioLogsSettingsProvider"; import TimelineInteractionStateProvider from "@lichtblick/suite-base/providers/TimelineInteractionStateProvider"; import UserProfileLocalStorageProvider from "@lichtblick/suite-base/providers/UserProfileLocalStorageProvider"; -import { Fragment, Suspense, useEffect, useMemo } from "react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; import Workspace from "./Workspace"; import DocumentTitleAdapter from "./components/DocumentTitleAdapter"; diff --git a/packages/suite-base/src/Workspace.stories.tsx b/packages/suite-base/src/Workspace.stories.tsx index cf78d7ef60..83762e6381 100644 --- a/packages/suite-base/src/Workspace.stories.tsx +++ b/packages/suite-base/src/Workspace.stories.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { fireEvent, screen, waitFor } from "@storybook/testing-library"; +import { useEffect, useState } from "react"; + import MultiProvider from "@lichtblick/suite-base/components/MultiProvider"; import Panel from "@lichtblick/suite-base/components/Panel"; import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; @@ -16,9 +23,6 @@ import Tab from "@lichtblick/suite-base/panels/Tab"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { fireEvent, screen, waitFor } from "@storybook/testing-library"; -import { useEffect, useState } from "react"; import Workspace from "./Workspace"; diff --git a/packages/suite-base/src/Workspace.tsx b/packages/suite-base/src/Workspace.tsx index 3fd271902f..d49d03ee2d 100644 --- a/packages/suite-base/src/Workspace.tsx +++ b/packages/suite-base/src/Workspace.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,6 +13,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Link, Typography } from "@mui/material"; +import { t } from "i18next"; +import { useSnackbar } from "notistack"; +import { extname } from "path"; +import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; +import { Trans, useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import Logger from "@lichtblick/log"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import AccountSettings from "@lichtblick/suite-base/components/AccountSettingsSidebar/AccountSettings"; @@ -78,13 +89,6 @@ import WorkspaceContextProvider from "@lichtblick/suite-base/providers/Workspace import ICONS from "@lichtblick/suite-base/theme/icons"; import { parseAppURLState } from "@lichtblick/suite-base/util/appURLState"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import { Link, Typography } from "@mui/material"; -import { t } from "i18next"; -import { useSnackbar } from "notistack"; -import { extname } from "path"; -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; -import { Trans, useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; import { useWorkspaceActions } from "./context/Workspace/useWorkspaceActions"; diff --git a/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.stories.tsx b/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.stories.tsx index 846675308c..73a3de7551 100644 --- a/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.stories.tsx +++ b/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { User } from "@lichtblick/suite-base/context/CurrentUserContext"; import { StoryObj } from "@storybook/react"; +import { User } from "@lichtblick/suite-base/context/CurrentUserContext"; + import AccountInfo from "./AccountInfo"; export default { diff --git a/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.tsx b/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.tsx index 7ae9bfab95..b5438343fb 100644 --- a/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.tsx +++ b/packages/suite-base/src/components/AccountSettingsSidebar/AccountInfo.tsx @@ -1,18 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import BlockheadFilledIcon from "@lichtblick/suite-base/components/BlockheadFilledIcon"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useCurrentUser, User } from "@lichtblick/suite-base/context/CurrentUserContext"; -import { useConfirm } from "@lichtblick/suite-base/hooks/useConfirm"; import { Button, CircularProgress, Typography } from "@mui/material"; import { useSnackbar } from "notistack"; import { useCallback } from "react"; import { useAsyncFn } from "react-use"; import { makeStyles } from "tss-react/mui"; +import Logger from "@lichtblick/log"; +import BlockheadFilledIcon from "@lichtblick/suite-base/components/BlockheadFilledIcon"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useCurrentUser, User } from "@lichtblick/suite-base/context/CurrentUserContext"; +import { useConfirm } from "@lichtblick/suite-base/hooks/useConfirm"; + const log = Logger.getLogger(__filename); const AVATAR_ICON_SIZE = 42; diff --git a/packages/suite-base/src/components/AccountSettingsSidebar/AccountSettings.tsx b/packages/suite-base/src/components/AccountSettingsSidebar/AccountSettings.tsx index 05a3fe8e00..cdeafc7fb6 100644 --- a/packages/suite-base/src/components/AccountSettingsSidebar/AccountSettings.tsx +++ b/packages/suite-base/src/components/AccountSettingsSidebar/AccountSettings.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo } from "react"; + import { SidebarContent } from "@lichtblick/suite-base/components/SidebarContent"; import { useCurrentUser } from "@lichtblick/suite-base/context/CurrentUserContext"; -import { useMemo } from "react"; import AccountInfo from "./AccountInfo"; import SigninForm from "./SigninForm"; diff --git a/packages/suite-base/src/components/AccountSettingsSidebar/AccountSyncGraphic.tsx b/packages/suite-base/src/components/AccountSettingsSidebar/AccountSyncGraphic.tsx index 6e3dce74e0..a3ece7d720 100644 --- a/packages/suite-base/src/components/AccountSettingsSidebar/AccountSyncGraphic.tsx +++ b/packages/suite-base/src/components/AccountSettingsSidebar/AccountSyncGraphic.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AccountSettingsSidebar/SigninForm.tsx b/packages/suite-base/src/components/AccountSettingsSidebar/SigninForm.tsx index a2555d7755..9976fb0b31 100644 --- a/packages/suite-base/src/components/AccountSettingsSidebar/SigninForm.tsx +++ b/packages/suite-base/src/components/AccountSettingsSidebar/SigninForm.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useCurrentUser } from "@lichtblick/suite-base/context/CurrentUserContext"; import { Button, Typography } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import { useCurrentUser } from "@lichtblick/suite-base/context/CurrentUserContext"; + import AccountSyncGraphic from "./AccountSyncGraphic"; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/AppBar/AddPanel.stories.tsx b/packages/suite-base/src/components/AppBar/AddPanel.stories.tsx index 11a4b8d8b3..105911a96f 100644 --- a/packages/suite-base/src/components/AppBar/AddPanel.stories.tsx +++ b/packages/suite-base/src/components/AppBar/AddPanel.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppBar/AddPanelMenu.tsx b/packages/suite-base/src/components/AppBar/AddPanelMenu.tsx index eaba5d75c9..88f962ff09 100644 --- a/packages/suite-base/src/components/AppBar/AddPanelMenu.tsx +++ b/packages/suite-base/src/components/AppBar/AddPanelMenu.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PanelCatalog } from "@lichtblick/suite-base/components/PanelCatalog"; -import useAddPanel from "@lichtblick/suite-base/hooks/useAddPanel"; import { Menu, PaperProps, PopoverPosition, PopoverReference } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import { PanelCatalog } from "@lichtblick/suite-base/components/PanelCatalog"; +import useAddPanel from "@lichtblick/suite-base/hooks/useAddPanel"; + const useStyles = makeStyles()((theme) => ({ menuList: { minWidth: 270, diff --git a/packages/suite-base/src/components/AppBar/AppBarContainer.tsx b/packages/suite-base/src/components/AppBar/AppBarContainer.tsx index 5c47871079..9dc8e2758b 100644 --- a/packages/suite-base/src/components/AppBar/AppBarContainer.tsx +++ b/packages/suite-base/src/components/AppBar/AppBarContainer.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppBar/AppBarDropdownButton.tsx b/packages/suite-base/src/components/AppBar/AppBarDropdownButton.tsx index b820abb511..4c0ab6876e 100644 --- a/packages/suite-base/src/components/AppBar/AppBarDropdownButton.tsx +++ b/packages/suite-base/src/components/AppBar/AppBarDropdownButton.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ChevronDown12Filled } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import TextMiddleTruncate from "@lichtblick/suite-base/components/TextMiddleTruncate"; import { ButtonBase, ButtonBaseProps, Typography } from "@mui/material"; import { forwardRef } from "react"; import tinycolor2 from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import TextMiddleTruncate from "@lichtblick/suite-base/components/TextMiddleTruncate"; + import { APP_BAR_HEIGHT } from "./constants"; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/AppBar/AppBarIconButton.tsx b/packages/suite-base/src/components/AppBar/AppBarIconButton.tsx index 30511b261a..dd26eb39d6 100644 --- a/packages/suite-base/src/components/AppBar/AppBarIconButton.tsx +++ b/packages/suite-base/src/components/AppBar/AppBarIconButton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppBar/AppMenu.stories.tsx b/packages/suite-base/src/components/AppBar/AppMenu.stories.tsx index 0c43a729c7..02dd73b67f 100644 --- a/packages/suite-base/src/components/AppBar/AppMenu.stories.tsx +++ b/packages/suite-base/src/components/AppBar/AppMenu.stories.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { PopoverPosition, PopoverReference } from "@mui/material"; +import { Meta, StoryObj } from "@storybook/react"; +import { userEvent, within } from "@storybook/testing-library"; +import * as _ from "lodash-es"; + import PlayerSelectionContext, { PlayerSelection, } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { PopoverPosition, PopoverReference } from "@mui/material"; -import { Meta, StoryObj } from "@storybook/react"; -import { userEvent, within } from "@storybook/testing-library"; -import * as _ from "lodash-es"; import { AppMenu } from "./AppMenu"; diff --git a/packages/suite-base/src/components/AppBar/AppMenu.tsx b/packages/suite-base/src/components/AppBar/AppMenu.tsx index 3def95862b..32705b9d2d 100644 --- a/packages/suite-base/src/components/AppBar/AppMenu.tsx +++ b/packages/suite-base/src/components/AppBar/AppMenu.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Menu, PaperProps, PopoverPosition, PopoverReference } from "@mui/material"; +import { useCallback, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import TextMiddleTruncate from "@lichtblick/suite-base/components/TextMiddleTruncate"; import { usePlayerSelection } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import { @@ -9,10 +17,6 @@ import { useWorkspaceStore, } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; -import { Menu, PaperProps, PopoverPosition, PopoverReference } from "@mui/material"; -import { useCallback, useMemo, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; import { NestedMenuItem } from "./NestedMenuItem"; import { AppBarMenuItem } from "./types"; diff --git a/packages/suite-base/src/components/AppBar/CustomWindowControls.tsx b/packages/suite-base/src/components/AppBar/CustomWindowControls.tsx index d400464926..46281dec73 100644 --- a/packages/suite-base/src/components/AppBar/CustomWindowControls.tsx +++ b/packages/suite-base/src/components/AppBar/CustomWindowControls.tsx @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank"; import CloseIcon from "@mui/icons-material/Close"; import FilterNoneIcon from "@mui/icons-material/FilterNone"; @@ -10,6 +12,8 @@ import MinimizeIcon from "@mui/icons-material/Minimize"; import { IconButton } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + export type CustomWindowControlsProps = { showCustomWindowControls?: boolean; isMaximized?: boolean; diff --git a/packages/suite-base/src/components/AppBar/DataSource.tsx b/packages/suite-base/src/components/AppBar/DataSource.tsx index e8277410fd..66948eb982 100644 --- a/packages/suite-base/src/components/AppBar/DataSource.tsx +++ b/packages/suite-base/src/components/AppBar/DataSource.tsx @@ -1,8 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ErrorCircle16Filled } from "@fluentui/react-icons"; +import { CircularProgress, IconButton } from "@mui/material"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import { MessagePipelineContext, useMessagePipeline, @@ -12,9 +19,6 @@ import TextMiddleTruncate from "@lichtblick/suite-base/components/TextMiddleTrun import WssErrorModal from "@lichtblick/suite-base/components/WssErrorModal"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; -import { CircularProgress, IconButton } from "@mui/material"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; import { EndTimestamp } from "./EndTimestamp"; diff --git a/packages/suite-base/src/components/AppBar/EndTimestamp.stories.tsx b/packages/suite-base/src/components/AppBar/EndTimestamp.stories.tsx index 887124a78d..0a8e8e65b4 100644 --- a/packages/suite-base/src/components/AppBar/EndTimestamp.stories.tsx +++ b/packages/suite-base/src/components/AppBar/EndTimestamp.stories.tsx @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; +import { Meta, StoryFn, StoryObj } from "@storybook/react"; +import { useState } from "react"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { Meta, StoryFn, StoryObj } from "@storybook/react"; -import { useState } from "react"; - -import { Time } from "@foxglove/rostime"; import { EndTimestamp } from "./EndTimestamp"; diff --git a/packages/suite-base/src/components/AppBar/EndTimestamp.tsx b/packages/suite-base/src/components/AppBar/EndTimestamp.tsx index 11c3d3264e..d54c5b2cdb 100644 --- a/packages/suite-base/src/components/AppBar/EndTimestamp.tsx +++ b/packages/suite-base/src/components/AppBar/EndTimestamp.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useTheme } from "@mui/material"; +import { useEffect, useRef } from "react"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { MessagePipelineContext, @@ -10,8 +16,6 @@ import { import { useAppConfigurationValue, useAppTimeFormat } from "@lichtblick/suite-base/hooks"; import { format } from "@lichtblick/suite-base/util/formatTime"; import { formatTimeRaw, isAbsoluteTime } from "@lichtblick/suite-base/util/time"; -import { useTheme } from "@mui/material"; -import { useEffect, useRef } from "react"; const selectEndTime = (ctx: MessagePipelineContext) => ctx.playerState.activeData?.endTime; diff --git a/packages/suite-base/src/components/AppBar/HelpMenu.tsx b/packages/suite-base/src/components/AppBar/HelpMenu.tsx index a66bed31b9..d6b735f494 100644 --- a/packages/suite-base/src/components/AppBar/HelpMenu.tsx +++ b/packages/suite-base/src/components/AppBar/HelpMenu.tsx @@ -1,11 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { Cloud24Regular } from "@fluentui/react-icons"; -import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; -import { useCurrentUserType } from "@lichtblick/suite-base/context/CurrentUserContext"; -import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import { ListItemText, Menu, @@ -16,6 +16,10 @@ import { } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; +import { useCurrentUserType } from "@lichtblick/suite-base/context/CurrentUserContext"; +import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; + const useStyles = makeStyles()((theme) => ({ paper: { width: 280, diff --git a/packages/suite-base/src/components/AppBar/NestedMenuItem.tsx b/packages/suite-base/src/components/AppBar/NestedMenuItem.tsx index d24331ef85..25cc0f8de2 100644 --- a/packages/suite-base/src/components/AppBar/NestedMenuItem.tsx +++ b/packages/suite-base/src/components/AppBar/NestedMenuItem.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppBar/SettingsMenu.tsx b/packages/suite-base/src/components/AppBar/SettingsMenu.tsx index dd36b1b04b..ea72c1831f 100644 --- a/packages/suite-base/src/components/AppBar/SettingsMenu.tsx +++ b/packages/suite-base/src/components/AppBar/SettingsMenu.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSettingsTab } from "@lichtblick/suite-base/components/AppSettingsDialog/AppSettingsDialog"; -import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { Menu, MenuItem, PaperProps, PopoverPosition, PopoverReference } from "@mui/material"; import { useCallback } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; +import { AppSettingsTab } from "@lichtblick/suite-base/components/AppSettingsDialog/AppSettingsDialog"; +import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; + const useStyles = makeStyles()({ menuList: { minWidth: 200, diff --git a/packages/suite-base/src/components/AppBar/StorybookDecorator.stories.tsx b/packages/suite-base/src/components/AppBar/StorybookDecorator.stories.tsx index 102bab97f2..4c2ff2771b 100644 --- a/packages/suite-base/src/components/AppBar/StorybookDecorator.stories.tsx +++ b/packages/suite-base/src/components/AppBar/StorybookDecorator.stories.tsx @@ -1,9 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /* eslint-disable storybook/story-exports */ +import { StoryFn } from "@storybook/react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import Panel from "@lichtblick/suite-base/components/Panel"; import PanelCatalogContext, { @@ -12,9 +19,6 @@ import PanelCatalogContext, { } from "@lichtblick/suite-base/context/PanelCatalogContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { StoryFn } from "@storybook/react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; const SamplePanel1 = function () { return
; diff --git a/packages/suite-base/src/components/AppBar/constants.ts b/packages/suite-base/src/components/AppBar/constants.ts index 9047a8354d..0b58688447 100644 --- a/packages/suite-base/src/components/AppBar/constants.ts +++ b/packages/suite-base/src/components/AppBar/constants.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppBar/index.stories.tsx b/packages/suite-base/src/components/AppBar/index.stories.tsx index 7cedcbc39a..fd6d944655 100644 --- a/packages/suite-base/src/components/AppBar/index.stories.tsx +++ b/packages/suite-base/src/components/AppBar/index.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { action } from "@storybook/addon-actions"; +import { Meta, StoryFn, StoryObj } from "@storybook/react"; + import MockMessagePipelineProvider, { MockMessagePipelineProps, } from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import Stack from "@lichtblick/suite-base/components/Stack"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; -import { action } from "@storybook/addon-actions"; -import { Meta, StoryFn, StoryObj } from "@storybook/react"; import { AppBar } from "."; import { StorybookDecorator } from "./StorybookDecorator.stories"; diff --git a/packages/suite-base/src/components/AppBar/index.test.tsx b/packages/suite-base/src/components/AppBar/index.test.tsx index a603cba973..0cbe6a7322 100644 --- a/packages/suite-base/src/components/AppBar/index.test.tsx +++ b/packages/suite-base/src/components/AppBar/index.test.tsx @@ -1,8 +1,13 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { render } from "@testing-library/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import MultiProvider from "@lichtblick/suite-base/components/MultiProvider"; import StudioToastProvider from "@lichtblick/suite-base/components/StudioToastProvider"; @@ -12,7 +17,6 @@ import TimelineInteractionStateProvider from "@lichtblick/suite-base/providers/T import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { render } from "@testing-library/react"; import { AppBar } from "."; diff --git a/packages/suite-base/src/components/AppBar/index.tsx b/packages/suite-base/src/components/AppBar/index.tsx index ec187647b3..4bf0e1a79f 100644 --- a/packages/suite-base/src/components/AppBar/index.tsx +++ b/packages/suite-base/src/components/AppBar/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,6 +13,12 @@ import { PanelRight24Regular, SlideAdd24Regular, } from "@fluentui/react-icons"; +import { Avatar, IconButton, Tooltip } from "@mui/material"; +import { useState } from "react"; +import { useTranslation } from "react-i18next"; +import tc from "tinycolor2"; +import { makeStyles } from "tss-react/mui"; + import { LichtblickLogo } from "@lichtblick/suite-base/components/LichtblickLogo"; import Stack from "@lichtblick/suite-base/components/Stack"; import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; @@ -22,11 +31,6 @@ import { useWorkspaceStore, } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; -import { Avatar, IconButton, Tooltip } from "@mui/material"; -import { useState } from "react"; -import { useTranslation } from "react-i18next"; -import tc from "tinycolor2"; -import { makeStyles } from "tss-react/mui"; import { AddPanelMenu } from "./AddPanelMenu"; import { AppBarContainer } from "./AppBarContainer"; diff --git a/packages/suite-base/src/components/AppBar/types.ts b/packages/suite-base/src/components/AppBar/types.ts index d89d08a200..d857bb386b 100644 --- a/packages/suite-base/src/components/AppBar/types.ts +++ b/packages/suite-base/src/components/AppBar/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.stories.tsx b/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.stories.tsx index bafe10ab1b..f66e7331a7 100644 --- a/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.stories.tsx +++ b/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.stories.tsx @@ -1,17 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import ExtensionMarketplaceContext, { - ExtensionMarketplace, -} from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; -import ExtensionCatalogProvider from "@lichtblick/suite-base/providers/ExtensionCatalogProvider"; -import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import { StoryFn, StoryObj } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; import * as _ from "lodash-es"; import { ExtensionInfo, ExtensionLoader } from "@lichtblick/suite-base"; +import ExtensionMarketplaceContext, { + ExtensionMarketplace, +} from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; +import ExtensionCatalogProvider from "@lichtblick/suite-base/providers/ExtensionCatalogProvider"; +import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import { AppSettingsDialog } from "./AppSettingsDialog"; diff --git a/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.tsx b/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.tsx index 8fa6a55224..b662afd2f3 100644 --- a/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.tsx +++ b/packages/suite-base/src/components/AppSettingsDialog/AppSettingsDialog.tsx @@ -1,21 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import OsContextSingleton from "@lichtblick/suite-base/OsContextSingleton"; -import CopyButton from "@lichtblick/suite-base/components/CopyButton"; -import { ExperimentalFeatureSettings } from "@lichtblick/suite-base/components/ExperimentalFeatureSettings"; -import ExtensionsSettings from "@lichtblick/suite-base/components/ExtensionsSettings"; -import LichtblickLogoText from "@lichtblick/suite-base/components/LichtblickLogoText"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; -import { - useWorkspaceStore, - WorkspaceContextStore, -} from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; -import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; import CloseIcon from "@mui/icons-material/Close"; import WarningAmberIcon from "@mui/icons-material/WarningAmber"; import { @@ -39,6 +28,21 @@ import { MouseEvent, SyntheticEvent, useState } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import OsContextSingleton from "@lichtblick/suite-base/OsContextSingleton"; +import CopyButton from "@lichtblick/suite-base/components/CopyButton"; +import { ExperimentalFeatureSettings } from "@lichtblick/suite-base/components/ExperimentalFeatureSettings"; +import ExtensionsSettings from "@lichtblick/suite-base/components/ExtensionsSettings"; +import LichtblickLogoText from "@lichtblick/suite-base/components/LichtblickLogoText"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; +import { + useWorkspaceStore, + WorkspaceContextStore, +} from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; +import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; + import { AutoUpdate, ColorSchemeSettings, diff --git a/packages/suite-base/src/components/AppSettingsDialog/index.tsx b/packages/suite-base/src/components/AppSettingsDialog/index.tsx index a53a53db1a..a35a89954c 100644 --- a/packages/suite-base/src/components/AppSettingsDialog/index.tsx +++ b/packages/suite-base/src/components/AppSettingsDialog/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AppSettingsDialog/settings.tsx b/packages/suite-base/src/components/AppSettingsDialog/settings.tsx index 7a10bc0b67..a6c3368f3c 100644 --- a/packages/suite-base/src/components/AppSettingsDialog/settings.tsx +++ b/packages/suite-base/src/components/AppSettingsDialog/settings.tsx @@ -1,19 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { filterMap } from "@lichtblick/den/collection"; -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import OsContextSingleton from "@lichtblick/suite-base/OsContextSingleton"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; -import { Language } from "@lichtblick/suite-base/i18n"; -import { reportError } from "@lichtblick/suite-base/reportError"; -import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; -import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; -import { formatTime } from "@lichtblick/suite-base/util/formatTime"; -import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; import Brightness5Icon from "@mui/icons-material/Brightness5"; import ComputerIcon from "@mui/icons-material/Computer"; import DarkModeIcon from "@mui/icons-material/DarkMode"; @@ -39,6 +30,19 @@ import { MouseEvent, useCallback, useMemo } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; +import { filterMap } from "@lichtblick/den/collection"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import OsContextSingleton from "@lichtblick/suite-base/OsContextSingleton"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; +import { Language } from "@lichtblick/suite-base/i18n"; +import { reportError } from "@lichtblick/suite-base/reportError"; +import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; +import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; +import { formatTime } from "@lichtblick/suite-base/util/formatTime"; +import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; + const MESSAGE_RATES = [1, 3, 5, 10, 15, 20, 30, 60]; const LANGUAGE_OPTIONS: { key: Language; value: string }[] = [{ key: "en", value: "English" }]; diff --git a/packages/suite-base/src/components/AutoSizingCanvas/index.stories.tsx b/packages/suite-base/src/components/AutoSizingCanvas/index.stories.tsx index 2c689dbdb7..d85ab3c3ee 100644 --- a/packages/suite-base/src/components/AutoSizingCanvas/index.stories.tsx +++ b/packages/suite-base/src/components/AutoSizingCanvas/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/AutoSizingCanvas/index.tsx b/packages/suite-base/src/components/AutoSizingCanvas/index.tsx index 9b1ea8fe88..86cb6b429d 100644 --- a/packages/suite-base/src/components/AutoSizingCanvas/index.tsx +++ b/packages/suite-base/src/components/AutoSizingCanvas/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Autocomplete/Autocomplete.stories.tsx b/packages/suite-base/src/components/Autocomplete/Autocomplete.stories.tsx index 9eed5e8cf6..77f3023ac1 100644 --- a/packages/suite-base/src/components/Autocomplete/Autocomplete.stories.tsx +++ b/packages/suite-base/src/components/Autocomplete/Autocomplete.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Stack from "@lichtblick/suite-base/components/Stack"; import { Meta, StoryFn, StoryObj } from "@storybook/react"; import { fireEvent, within } from "@storybook/testing-library"; import * as _ from "lodash-es"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { Autocomplete } from "./Autocomplete"; export default { diff --git a/packages/suite-base/src/components/Autocomplete/Autocomplete.tsx b/packages/suite-base/src/components/Autocomplete/Autocomplete.tsx index 9b915a5000..5a1627f62f 100644 --- a/packages/suite-base/src/components/Autocomplete/Autocomplete.tsx +++ b/packages/suite-base/src/components/Autocomplete/Autocomplete.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Autocomplete/ReactWindowListboxAdapter.tsx b/packages/suite-base/src/components/Autocomplete/ReactWindowListboxAdapter.tsx index b07889f9a6..4b9e254e92 100644 --- a/packages/suite-base/src/components/Autocomplete/ReactWindowListboxAdapter.tsx +++ b/packages/suite-base/src/components/Autocomplete/ReactWindowListboxAdapter.tsx @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { HighlightChars } from "@lichtblick/suite-base/components/HighlightChars"; import { AutocompleteRenderOptionState } from "@mui/material/Autocomplete"; import MenuItem from "@mui/material/MenuItem"; import { FzfResultItem } from "fzf"; @@ -10,6 +12,8 @@ import { useMemo, ReactNode } from "react"; import { FixedSizeList, ListChildComponentProps } from "react-window"; import { makeStyles } from "tss-react/mui"; +import { HighlightChars } from "@lichtblick/suite-base/components/HighlightChars"; + const Constants = Object.freeze({ LISTBOX_PADDING: 8, ROW_HEIGHT: 26, diff --git a/packages/suite-base/src/components/Autocomplete/index.ts b/packages/suite-base/src/components/Autocomplete/index.ts index 91ab9f7cab..00a8eead4f 100644 --- a/packages/suite-base/src/components/Autocomplete/index.ts +++ b/packages/suite-base/src/components/Autocomplete/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/BlockheadFilledIcon.tsx b/packages/suite-base/src/components/BlockheadFilledIcon.tsx index 28b947749c..1bb7470b19 100644 --- a/packages/suite-base/src/components/BlockheadFilledIcon.tsx +++ b/packages/suite-base/src/components/BlockheadFilledIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/BlockheadIcon.tsx b/packages/suite-base/src/components/BlockheadIcon.tsx index c87df315af..5ccfd5c58f 100644 --- a/packages/suite-base/src/components/BlockheadIcon.tsx +++ b/packages/suite-base/src/components/BlockheadIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/BuiltinIcon.tsx b/packages/suite-base/src/components/BuiltinIcon.tsx index 307d1c9086..cfa86ef1ba 100644 --- a/packages/suite-base/src/components/BuiltinIcon.tsx +++ b/packages/suite-base/src/components/BuiltinIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/CaptureErrorBoundary.tsx b/packages/suite-base/src/components/CaptureErrorBoundary.tsx index ee013d06d0..213ad75008 100644 --- a/packages/suite-base/src/components/CaptureErrorBoundary.tsx +++ b/packages/suite-base/src/components/CaptureErrorBoundary.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/datasets.test.ts b/packages/suite-base/src/components/Chart/datasets.test.ts index 6a46b7e777..c210fe4ad6 100644 --- a/packages/suite-base/src/components/Chart/datasets.test.ts +++ b/packages/suite-base/src/components/Chart/datasets.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/datasets.ts b/packages/suite-base/src/components/Chart/datasets.ts index 35240ecd61..e1195b60b7 100644 --- a/packages/suite-base/src/components/Chart/datasets.ts +++ b/packages/suite-base/src/components/Chart/datasets.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/index.stories.tsx b/packages/suite-base/src/components/Chart/index.stories.tsx index 38a376e507..0d15aa1d01 100644 --- a/packages/suite-base/src/components/Chart/index.stories.tsx +++ b/packages/suite-base/src/components/Chart/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,12 +13,13 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; import { StoryObj } from "@storybook/react"; import * as _ from "lodash-es"; import { useState, useCallback, ComponentProps, useEffect } from "react"; import TestUtils from "react-dom/test-utils"; +import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; + import ChartComponent, { OnClickArg } from "."; const dataPoint = { diff --git a/packages/suite-base/src/components/Chart/index.tsx b/packages/suite-base/src/components/Chart/index.tsx index c8aecad120..95642b712f 100644 --- a/packages/suite-base/src/components/Chart/index.tsx +++ b/packages/suite-base/src/components/Chart/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -8,13 +11,7 @@ /// /// -import Logger from "@lichtblick/log"; -import ChartJsMux, { - ChartUpdateMessage, -} from "@lichtblick/suite-base/components/Chart/worker/ChartJsMux"; -import Rpc, { createLinkedChannels } from "@lichtblick/suite-base/util/Rpc"; -import WebWorkerManager from "@lichtblick/suite-base/util/WebWorkerManager"; -import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; +import { type ZoomPluginOptions } from "@foxglove/chartjs-plugin-zoom/types/options"; import { ChartOptions } from "chart.js"; import Hammer from "hammerjs"; import * as R from "ramda"; @@ -23,7 +20,13 @@ import { useMountedState } from "react-use"; import { assert } from "ts-essentials"; import { v4 as uuidv4 } from "uuid"; -import { type ZoomPluginOptions } from "@foxglove/chartjs-plugin-zoom/types/options"; +import Logger from "@lichtblick/log"; +import ChartJsMux, { + ChartUpdateMessage, +} from "@lichtblick/suite-base/components/Chart/worker/ChartJsMux"; +import Rpc, { createLinkedChannels } from "@lichtblick/suite-base/util/Rpc"; +import WebWorkerManager from "@lichtblick/suite-base/util/WebWorkerManager"; +import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; import { TypedChartData, ChartData, RpcElement, RpcScales } from "./types"; diff --git a/packages/suite-base/src/components/Chart/types.ts b/packages/suite-base/src/components/Chart/types.ts index 87cff55aaf..ccf8e7fe39 100644 --- a/packages/suite-base/src/components/Chart/types.ts +++ b/packages/suite-base/src/components/Chart/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/worker/ChartJSManager.ts b/packages/suite-base/src/components/Chart/worker/ChartJSManager.ts index 88632dd37c..ce38aeabb9 100644 --- a/packages/suite-base/src/components/Chart/worker/ChartJSManager.ts +++ b/packages/suite-base/src/components/Chart/worker/ChartJSManager.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Logger from "@lichtblick/log"; -import { RpcElement, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; -import { maybeCast } from "@lichtblick/suite-base/util/maybeCast"; +import { Zoom as ZoomPlugin } from "@foxglove/chartjs-plugin-zoom"; +import { fontMonospace } from "@foxglove/theme"; import { Chart, ChartData, @@ -29,8 +31,9 @@ import DatalabelPlugin from "chartjs-plugin-datalabels"; import { type Options as DatalabelsPluginOptions } from "chartjs-plugin-datalabels/types/options"; import EventEmitter from "eventemitter3"; -import { Zoom as ZoomPlugin } from "@foxglove/chartjs-plugin-zoom"; -import { fontMonospace } from "@foxglove/theme"; +import Logger from "@lichtblick/log"; +import { RpcElement, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; +import { maybeCast } from "@lichtblick/suite-base/util/maybeCast"; import { lineSegmentLabelColor } from "./lineSegments"; import { proxyTyped } from "./proxy"; diff --git a/packages/suite-base/src/components/Chart/worker/ChartJsMux.ts b/packages/suite-base/src/components/Chart/worker/ChartJsMux.ts index 0b373084bc..726a0806bd 100644 --- a/packages/suite-base/src/components/Chart/worker/ChartJsMux.ts +++ b/packages/suite-base/src/components/Chart/worker/ChartJsMux.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import PlexMono from "@lichtblick/suite-base/styles/assets/PlexMono.woff2"; -import Rpc from "@lichtblick/suite-base/util/Rpc"; -import { setupWorker } from "@lichtblick/suite-base/util/RpcWorkerUtils"; import { CategoryScale, Chart, @@ -34,6 +34,10 @@ import { } from "chart.js"; import AnnotationPlugin from "chartjs-plugin-annotation"; +import PlexMono from "@lichtblick/suite-base/styles/assets/PlexMono.woff2"; +import Rpc from "@lichtblick/suite-base/util/Rpc"; +import { setupWorker } from "@lichtblick/suite-base/util/RpcWorkerUtils"; + import ChartJSManager, { InitOpts } from "./ChartJSManager"; import { TypedChartData } from "../types"; diff --git a/packages/suite-base/src/components/Chart/worker/lineSegments.ts b/packages/suite-base/src/components/Chart/worker/lineSegments.ts index 4ea4757922..610fda964b 100644 --- a/packages/suite-base/src/components/Chart/worker/lineSegments.ts +++ b/packages/suite-base/src/components/Chart/worker/lineSegments.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/worker/main.ts b/packages/suite-base/src/components/Chart/worker/main.ts index d79adc6602..149f674c45 100644 --- a/packages/suite-base/src/components/Chart/worker/main.ts +++ b/packages/suite-base/src/components/Chart/worker/main.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Chart/worker/proxy.ts b/packages/suite-base/src/components/Chart/worker/proxy.ts index 9cea6b33d7..e1d5d63fb7 100644 --- a/packages/suite-base/src/components/Chart/worker/proxy.ts +++ b/packages/suite-base/src/components/Chart/worker/proxy.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/ColorSchemeThemeProvider.tsx b/packages/suite-base/src/components/ColorSchemeThemeProvider.tsx index af6efeb0dd..7ffcc6910e 100644 --- a/packages/suite-base/src/components/ColorSchemeThemeProvider.tsx +++ b/packages/suite-base/src/components/ColorSchemeThemeProvider.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMedia } from "react-use"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import { useMedia } from "react-use"; export function ColorSchemeThemeProvider({ children }: React.PropsWithChildren): JSX.Element { const [colorScheme = "system"] = useAppConfigurationValue(AppSetting.COLOR_SCHEME); diff --git a/packages/suite-base/src/components/CopyButton.tsx b/packages/suite-base/src/components/CopyButton.tsx index 52c1a14e8d..4dbfa7fe7d 100644 --- a/packages/suite-base/src/components/CopyButton.tsx +++ b/packages/suite-base/src/components/CopyButton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,7 +13,6 @@ import { Checkmark20Filled, Checkmark24Filled, } from "@fluentui/react-icons"; -import clipboard from "@lichtblick/suite-base/util/clipboard"; import { Button, ButtonProps, @@ -22,6 +24,8 @@ import { } from "@mui/material"; import { useCallback, useState, PropsWithChildren, useMemo } from "react"; +import clipboard from "@lichtblick/suite-base/util/clipboard"; + function CopyButtonComponent( props: PropsWithChildren<{ getText: () => string; diff --git a/packages/suite-base/src/components/CreateEventDialog.stories.tsx b/packages/suite-base/src/components/CreateEventDialog.stories.tsx index 4e23a3183b..530d6a088d 100644 --- a/packages/suite-base/src/components/CreateEventDialog.stories.tsx +++ b/packages/suite-base/src/components/CreateEventDialog.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; -import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; import { StoryObj, StoryFn, Meta } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; +import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; +import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; + import { CreateEventDialog } from "./CreateEventDialog"; export default { diff --git a/packages/suite-base/src/components/CreateEventDialog.tsx b/packages/suite-base/src/components/CreateEventDialog.tsx index 17db3333c5..80ca178571 100644 --- a/packages/suite-base/src/components/CreateEventDialog.tsx +++ b/packages/suite-base/src/components/CreateEventDialog.tsx @@ -1,16 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; -import { - MessagePipelineContext, - useMessagePipeline, -} from "@lichtblick/suite-base/components/MessagePipeline"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; -import { EventsStore, useEvents } from "@lichtblick/suite-base/context/EventsContext"; -import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; +import { toDate, toNanoSec } from "@foxglove/rostime"; import AddIcon from "@mui/icons-material/Add"; import RemoveIcon from "@mui/icons-material/Remove"; import { @@ -37,7 +32,15 @@ import { keyframes } from "tss-react"; import { makeStyles } from "tss-react/mui"; import { useImmer } from "use-immer"; -import { toDate, toNanoSec } from "@foxglove/rostime"; +import Log from "@lichtblick/log"; +import { + MessagePipelineContext, + useMessagePipeline, +} from "@lichtblick/suite-base/components/MessagePipeline"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; +import { EventsStore, useEvents } from "@lichtblick/suite-base/context/EventsContext"; +import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; const log = Log.getLogger(__filename); diff --git a/packages/suite-base/src/components/CssBaseline.stories.tsx b/packages/suite-base/src/components/CssBaseline.stories.tsx index 0b1c2bcd4b..04424abfbd 100644 --- a/packages/suite-base/src/components/CssBaseline.stories.tsx +++ b/packages/suite-base/src/components/CssBaseline.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/CssBaseline.tsx b/packages/suite-base/src/components/CssBaseline.tsx index db6095097e..f6e2b82723 100644 --- a/packages/suite-base/src/components/CssBaseline.tsx +++ b/packages/suite-base/src/components/CssBaseline.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/CurrentLayoutLocalStorageSyncAdapter.tsx b/packages/suite-base/src/components/CurrentLayoutLocalStorageSyncAdapter.tsx index d865d42dd2..11f6cfffbc 100644 --- a/packages/suite-base/src/components/CurrentLayoutLocalStorageSyncAdapter.tsx +++ b/packages/suite-base/src/components/CurrentLayoutLocalStorageSyncAdapter.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import assert from "assert"; +import { useEffect } from "react"; +import { useAsync } from "react-use"; +import { useDebounce } from "use-debounce"; + import Log from "@lichtblick/log"; import { LOCAL_STORAGE_STUDIO_LAYOUT_KEY } from "@lichtblick/suite-base/constants/localStorageKeys"; import { @@ -14,10 +22,6 @@ import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerCo import { usePlayerSelection } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import { defaultLayout } from "@lichtblick/suite-base/providers/CurrentLayoutProvider/defaultLayout"; import { migratePanelsState } from "@lichtblick/suite-base/services/migrateLayout"; -import assert from "assert"; -import { useEffect } from "react"; -import { useAsync } from "react-use"; -import { useDebounce } from "use-debounce"; function selectLayoutData(state: LayoutState) { return state.selectedLayout?.data; diff --git a/packages/suite-base/src/components/CurrentLayoutSyncAdapter.tsx b/packages/suite-base/src/components/CurrentLayoutSyncAdapter.tsx index d92994c7b6..58f07bd836 100644 --- a/packages/suite-base/src/components/CurrentLayoutSyncAdapter.tsx +++ b/packages/suite-base/src/components/CurrentLayoutSyncAdapter.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { enqueueSnackbar } from "notistack"; +import { useEffect, useState } from "react"; +import { useAsync, useMountedState } from "react-use"; +import { useDebounce } from "use-debounce"; + import Logger from "@lichtblick/log"; import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; import { @@ -11,10 +19,6 @@ import { } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerContext"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import { enqueueSnackbar } from "notistack"; -import { useEffect, useState } from "react"; -import { useAsync, useMountedState } from "react-use"; -import { useDebounce } from "use-debounce"; type UpdatedLayout = NonNullable; diff --git a/packages/suite-base/src/components/DataSourceDialog/Connection.stories.tsx b/packages/suite-base/src/components/DataSourceDialog/Connection.stories.tsx index db1266117f..e3e41d48be 100644 --- a/packages/suite-base/src/components/DataSourceDialog/Connection.stories.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/Connection.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryFn, StoryObj } from "@storybook/react"; + import PlayerSelectionContext, { PlayerSelection, } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { StoryFn, StoryObj } from "@storybook/react"; import { DataSourceDialog } from "./DataSourceDialog"; diff --git a/packages/suite-base/src/components/DataSourceDialog/Connection.tsx b/packages/suite-base/src/components/DataSourceDialog/Connection.tsx index 09e4d38053..7c4758ed86 100644 --- a/packages/suite-base/src/components/DataSourceDialog/Connection.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/Connection.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Alert, Link, Tab, Tabs, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { useState, useMemo, useCallback, useLayoutEffect, FormEvent } from "react"; +import { makeStyles } from "tss-react/mui"; + import { BuiltinIcon } from "@lichtblick/suite-base/components/BuiltinIcon"; import Stack from "@lichtblick/suite-base/components/Stack"; import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; @@ -12,9 +19,6 @@ import { } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import { Alert, Link, Tab, Tabs, Typography, useMediaQuery, useTheme } from "@mui/material"; -import { useState, useMemo, useCallback, useLayoutEffect, FormEvent } from "react"; -import { makeStyles } from "tss-react/mui"; import { FormField } from "./FormField"; import View from "./View"; diff --git a/packages/suite-base/src/components/DataSourceDialog/DataSourceDialog.tsx b/packages/suite-base/src/components/DataSourceDialog/DataSourceDialog.tsx index fc79216e17..360b8f00e7 100644 --- a/packages/suite-base/src/components/DataSourceDialog/DataSourceDialog.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/DataSourceDialog.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import CloseIcon from "@mui/icons-material/Close"; +import { Dialog, IconButton } from "@mui/material"; +import { useCallback, useLayoutEffect, useMemo, useRef } from "react"; +import { useMountedState } from "react-use"; +import { makeStyles } from "tss-react/mui"; + import Snow from "@lichtblick/suite-base/components/DataSourceDialog/Snow"; import Stack from "@lichtblick/suite-base/components/Stack"; import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; @@ -12,11 +21,6 @@ import { } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import CloseIcon from "@mui/icons-material/Close"; -import { Dialog, IconButton } from "@mui/material"; -import { useCallback, useLayoutEffect, useMemo, useRef } from "react"; -import { useMountedState } from "react-use"; -import { makeStyles } from "tss-react/mui"; import Connection from "./Connection"; import Start from "./Start"; diff --git a/packages/suite-base/src/components/DataSourceDialog/FormField.tsx b/packages/suite-base/src/components/DataSourceDialog/FormField.tsx index 0ffaecd757..d3e783a426 100644 --- a/packages/suite-base/src/components/DataSourceDialog/FormField.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/FormField.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Field } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import { FormHelperText, TextField } from "@mui/material"; import { ChangeEvent, useState } from "react"; +import { Field } from "@lichtblick/suite-base/context/PlayerSelectionContext"; + type Props = { disabled: boolean; field: Field; diff --git a/packages/suite-base/src/components/DataSourceDialog/Snow.tsx b/packages/suite-base/src/components/DataSourceDialog/Snow.tsx index 72da5e9a7c..9f37bfce2c 100644 --- a/packages/suite-base/src/components/DataSourceDialog/Snow.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/Snow.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/DataSourceDialog/Start.stories.tsx b/packages/suite-base/src/components/DataSourceDialog/Start.stories.tsx index f27e8ad8d9..ed34b230f4 100644 --- a/packages/suite-base/src/components/DataSourceDialog/Start.stories.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/Start.stories.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryFn, StoryObj } from "@storybook/react"; +import { ReactNode } from "react"; + import BaseUserContext, { CurrentUser, UserType, @@ -11,8 +17,6 @@ import PlayerSelectionContext, { } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { StoryFn, StoryObj } from "@storybook/react"; -import { ReactNode } from "react"; import { DataSourceDialog } from "./DataSourceDialog"; diff --git a/packages/suite-base/src/components/DataSourceDialog/Start.tsx b/packages/suite-base/src/components/DataSourceDialog/Start.tsx index 8982e47cd2..fc3e98164c 100644 --- a/packages/suite-base/src/components/DataSourceDialog/Start.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/Start.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Button, Link, List, ListItem, ListItemButton, SvgIcon, Typography } from "@mui/material"; +import { ReactNode, useMemo } from "react"; +import { useTranslation } from "react-i18next"; +import tinycolor from "tinycolor2"; +import { makeStyles } from "tss-react/mui"; + import { DataSourceDialogItem } from "@lichtblick/suite-base/components/DataSourceDialog/DataSourceDialog"; import LichtblickLogoText from "@lichtblick/suite-base/components/LichtblickLogoText"; import Stack from "@lichtblick/suite-base/components/Stack"; @@ -11,11 +20,6 @@ import { useCurrentUser } from "@lichtblick/suite-base/context/BaseUserContext"; import { usePlayerSelection } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import { Button, Link, List, ListItem, ListItemButton, SvgIcon, Typography } from "@mui/material"; -import { ReactNode, useMemo } from "react"; -import { useTranslation } from "react-i18next"; -import tinycolor from "tinycolor2"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ logo: { diff --git a/packages/suite-base/src/components/DataSourceDialog/View.tsx b/packages/suite-base/src/components/DataSourceDialog/View.tsx index f7aa889a84..1cfb126640 100644 --- a/packages/suite-base/src/components/DataSourceDialog/View.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/View.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import { Button } from "@mui/material"; import { PropsWithChildren } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; + type ViewProps = { onOpen?: () => void; }; diff --git a/packages/suite-base/src/components/DataSourceDialog/index.stories.tsx b/packages/suite-base/src/components/DataSourceDialog/index.stories.tsx index d5d7e3cfc3..e4aeb4cbf1 100644 --- a/packages/suite-base/src/components/DataSourceDialog/index.stories.tsx +++ b/packages/suite-base/src/components/DataSourceDialog/index.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryFn, StoryObj } from "@storybook/react"; + import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { StoryFn, StoryObj } from "@storybook/react"; import { DataSourceDialog } from "./DataSourceDialog"; diff --git a/packages/suite-base/src/components/DataSourceDialog/index.ts b/packages/suite-base/src/components/DataSourceDialog/index.ts index e819bd64b2..06c39a6e2d 100644 --- a/packages/suite-base/src/components/DataSourceDialog/index.ts +++ b/packages/suite-base/src/components/DataSourceDialog/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/DataSourceInfoView.tsx b/packages/suite-base/src/components/DataSourceInfoView.tsx index d1afb5f0b8..ad18ac4c39 100644 --- a/packages/suite-base/src/components/DataSourceInfoView.tsx +++ b/packages/suite-base/src/components/DataSourceInfoView.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { subtract as subtractTimes, Time } from "@foxglove/rostime"; +import { Skeleton, Typography } from "@mui/material"; +import { MutableRefObject, useEffect, useRef } from "react"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import { MessagePipelineContext, useMessagePipeline, @@ -12,12 +21,6 @@ import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; import { formatDuration } from "@lichtblick/suite-base/util/formatTime"; import { formatTimeRaw, isAbsoluteTime } from "@lichtblick/suite-base/util/time"; -import { Skeleton, Typography } from "@mui/material"; -import { MutableRefObject, useEffect, useRef } from "react"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; - -import { subtract as subtractTimes, Time } from "@foxglove/rostime"; import { MultilineMiddleTruncate } from "./MultilineMiddleTruncate"; diff --git a/packages/suite-base/src/components/DataSourceSidebar/DataSourceSidebar.tsx b/packages/suite-base/src/components/DataSourceSidebar/DataSourceSidebar.tsx index d5f045cf3a..afb01967bf 100644 --- a/packages/suite-base/src/components/DataSourceSidebar/DataSourceSidebar.tsx +++ b/packages/suite-base/src/components/DataSourceSidebar/DataSourceSidebar.tsx @@ -1,8 +1,24 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -/* eslint-disable @foxglove/no-restricted-imports */ +/* eslint-disable @lichtblick/no-restricted-imports */ + +import AddIcon from "@mui/icons-material/Add"; +import { + CircularProgress, + Divider, + IconButton, + Tab, + Tabs, + styled as muiStyled, +} from "@mui/material"; +import { useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { EventsList } from "@lichtblick/suite-base/components/EventsList"; @@ -19,18 +35,6 @@ import { EventsStore, useEvents } from "@lichtblick/suite-base/context/EventsCon import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; -import AddIcon from "@mui/icons-material/Add"; -import { - CircularProgress, - Divider, - IconButton, - Tab, - Tabs, - styled as muiStyled, -} from "@mui/material"; -import { useEffect, useMemo, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; import { DataSourceInfoView } from "../DataSourceInfoView"; import { ProblemsList } from "../ProblemsList"; diff --git a/packages/suite-base/src/components/DirectTopicStatsUpdater.tsx b/packages/suite-base/src/components/DirectTopicStatsUpdater.tsx index 42636e7dc1..be56fb983f 100644 --- a/packages/suite-base/src/components/DirectTopicStatsUpdater.tsx +++ b/packages/suite-base/src/components/DirectTopicStatsUpdater.tsx @@ -1,17 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; +import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react"; +import { useLatest } from "react-use"; + import { MessagePipelineContext, useMessagePipeline, } from "@lichtblick/suite-base/components/MessagePipeline"; import { useTopicPublishFrequencies } from "@lichtblick/suite-base/hooks/useTopicPublishFrequences"; import { PlayerCapabilities, TopicStats } from "@lichtblick/suite-base/players/types"; -import { useCallback, useEffect, useLayoutEffect, useMemo, useRef } from "react"; -import { useLatest } from "react-use"; - -import { Time } from "@foxglove/rostime"; const EM_DASH = "\u2014"; const EMPTY_TOPIC_STATS = new Map(); diff --git a/packages/suite-base/src/components/DocumentDropListener.test.tsx b/packages/suite-base/src/components/DocumentDropListener.test.tsx index 143869bc5f..e021f45b7a 100644 --- a/packages/suite-base/src/components/DocumentDropListener.test.tsx +++ b/packages/suite-base/src/components/DocumentDropListener.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import DocumentDropListener from "@lichtblick/suite-base/components/DocumentDropListener"; -import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { SnackbarProvider } from "notistack"; import ReactDOM from "react-dom"; import { act } from "react-dom/test-utils"; +import DocumentDropListener from "@lichtblick/suite-base/components/DocumentDropListener"; +import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; + describe("", () => { let wrapper: HTMLDivElement; let windowDragoverHandler: typeof jest.fn; diff --git a/packages/suite-base/src/components/DocumentDropListener.tsx b/packages/suite-base/src/components/DocumentDropListener.tsx index 7a5396b82b..4cf828f19e 100644 --- a/packages/suite-base/src/components/DocumentDropListener.tsx +++ b/packages/suite-base/src/components/DocumentDropListener.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Logger from "@lichtblick/log"; -import DropOverlay from "@lichtblick/suite-base/components/DropOverlay"; import { useSnackbar } from "notistack"; import { extname } from "path"; import { useCallback, useLayoutEffect, useState } from "react"; +import Logger from "@lichtblick/log"; +import DropOverlay from "@lichtblick/suite-base/components/DropOverlay"; + const log = Logger.getLogger(__filename); type Props = { diff --git a/packages/suite-base/src/components/DocumentTitleAdapter.tsx b/packages/suite-base/src/components/DocumentTitleAdapter.tsx index a85ab5360e..a7b77cbd8a 100644 --- a/packages/suite-base/src/components/DocumentTitleAdapter.tsx +++ b/packages/suite-base/src/components/DocumentTitleAdapter.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useEffect } from "react"; + import { MessagePipelineContext, useMessagePipeline, } from "@lichtblick/suite-base/components/MessagePipeline"; -import { useEffect } from "react"; const selectPlayerName = (ctx: MessagePipelineContext) => ctx.playerState.name; diff --git a/packages/suite-base/src/components/DropOverlay.stories.tsx b/packages/suite-base/src/components/DropOverlay.stories.tsx index 13dbc2a09f..7bf6307203 100644 --- a/packages/suite-base/src/components/DropOverlay.stories.tsx +++ b/packages/suite-base/src/components/DropOverlay.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import DropOverlay from "@lichtblick/suite-base/components/DropOverlay"; import { StoryObj } from "@storybook/react"; +import DropOverlay from "@lichtblick/suite-base/components/DropOverlay"; + export default { title: "components/DropOverlay", component: DropOverlay, diff --git a/packages/suite-base/src/components/DropOverlay.tsx b/packages/suite-base/src/components/DropOverlay.tsx index 9acb0b4eb5..6c97872ddf 100644 --- a/packages/suite-base/src/components/DropOverlay.tsx +++ b/packages/suite-base/src/components/DropOverlay.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/EmptyPanelLayout.tsx b/packages/suite-base/src/components/EmptyPanelLayout.tsx index c15899cbcd..778ff7e1c8 100644 --- a/packages/suite-base/src/components/EmptyPanelLayout.tsx +++ b/packages/suite-base/src/components/EmptyPanelLayout.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { PanelCatalog, PanelSelection } from "@lichtblick/suite-base/components/PanelCatalog"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; -import { MosaicDropResult } from "@lichtblick/suite-base/types/panels"; -import { getPanelIdForType } from "@lichtblick/suite-base/util/layout"; import { Typography } from "@mui/material"; import { useCallback } from "react"; import { useDrop } from "react-dnd"; @@ -23,6 +21,12 @@ import { useTranslation } from "react-i18next"; import { MosaicDragType } from "react-mosaic-component"; import { makeStyles } from "tss-react/mui"; +import { PanelCatalog, PanelSelection } from "@lichtblick/suite-base/components/PanelCatalog"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; +import { MosaicDropResult } from "@lichtblick/suite-base/types/panels"; +import { getPanelIdForType } from "@lichtblick/suite-base/util/layout"; + type Props = { tabId?: string; }; diff --git a/packages/suite-base/src/components/EmptyState.tsx b/packages/suite-base/src/components/EmptyState.tsx index a1e2fd14bf..2a52951e49 100644 --- a/packages/suite-base/src/components/EmptyState.tsx +++ b/packages/suite-base/src/components/EmptyState.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { Typography } from "@mui/material"; import { ReactNode } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme) => ({ root: { whiteSpace: "pre-line", diff --git a/packages/suite-base/src/components/ErrorBoundary.stories.tsx b/packages/suite-base/src/components/ErrorBoundary.stories.tsx index 967230aad5..c2f2ed8216 100644 --- a/packages/suite-base/src/components/ErrorBoundary.stories.tsx +++ b/packages/suite-base/src/components/ErrorBoundary.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/ErrorBoundary.tsx b/packages/suite-base/src/components/ErrorBoundary.tsx index 760ff37ca9..e21de3f46c 100644 --- a/packages/suite-base/src/components/ErrorBoundary.tsx +++ b/packages/suite-base/src/components/ErrorBoundary.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Link, Button, Typography } from "@mui/material"; +import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { reportError } from "@lichtblick/suite-base/reportError"; import { AppError } from "@lichtblick/suite-base/util/errors"; -import { Link, Button, Typography } from "@mui/material"; -import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react"; import ErrorDisplay from "./ErrorDisplay"; diff --git a/packages/suite-base/src/components/ErrorDisplay.tsx b/packages/suite-base/src/components/ErrorDisplay.tsx index ba477697f6..2f89faea53 100644 --- a/packages/suite-base/src/components/ErrorDisplay.tsx +++ b/packages/suite-base/src/components/ErrorDisplay.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { Typography, Link, Divider } from "@mui/material"; import { ErrorInfo, useMemo, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme) => ({ grid: { display: "grid", diff --git a/packages/suite-base/src/components/EventIcon.tsx b/packages/suite-base/src/components/EventIcon.tsx index 448704674c..caa9f2898b 100644 --- a/packages/suite-base/src/components/EventIcon.tsx +++ b/packages/suite-base/src/components/EventIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/EventOutlinedIcon.tsx b/packages/suite-base/src/components/EventOutlinedIcon.tsx index 7d015c1a2f..eb1272f00a 100644 --- a/packages/suite-base/src/components/EventOutlinedIcon.tsx +++ b/packages/suite-base/src/components/EventOutlinedIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/EventView.tsx b/packages/suite-base/src/components/EventView.tsx index 8813204f49..57c47d3a3c 100644 --- a/packages/suite-base/src/components/EventView.tsx +++ b/packages/suite-base/src/components/EventView.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { alpha } from "@mui/material"; +import * as _ from "lodash-es"; +import { Fragment } from "react"; +import { makeStyles } from "tss-react/mui"; + import { HighlightedText } from "@lichtblick/suite-base/components/HighlightedText"; import { TimelinePositionedEvent, DataSourceEvent, } from "@lichtblick/suite-base/context/EventsContext"; -import { alpha } from "@mui/material"; -import * as _ from "lodash-es"; -import { Fragment } from "react"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()( (theme, _params, classes) => ({ diff --git a/packages/suite-base/src/components/EventsList.stories.tsx b/packages/suite-base/src/components/EventsList.stories.tsx index c21f016fd2..eda42a7b88 100644 --- a/packages/suite-base/src/components/EventsList.stories.tsx +++ b/packages/suite-base/src/components/EventsList.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj, StoryFn } from "@storybook/react"; +import { screen, userEvent } from "@storybook/testing-library"; +import { useEffect } from "react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { useEvents } from "@lichtblick/suite-base/context/EventsContext"; import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; import { makeMockEvents } from "@lichtblick/suite-base/test/mocks/makeMockEvents"; -import { StoryObj, StoryFn } from "@storybook/react"; -import { screen, userEvent } from "@storybook/testing-library"; -import { useEffect } from "react"; import { EventsList } from "./EventsList"; diff --git a/packages/suite-base/src/components/EventsList.tsx b/packages/suite-base/src/components/EventsList.tsx index 3482416283..fb89fba3df 100644 --- a/packages/suite-base/src/components/EventsList.tsx +++ b/packages/suite-base/src/components/EventsList.tsx @@ -1,7 +1,23 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import ClearIcon from "@mui/icons-material/Clear"; +import SearchIcon from "@mui/icons-material/Search"; +import { + AppBar, + CircularProgress, + IconButton, + InputAdornment, + TextField, + Typography, +} from "@mui/material"; +import { useCallback, useMemo } from "react"; +import { makeStyles } from "tss-react/mui"; + import { MessagePipelineContext, useMessagePipeline, @@ -17,18 +33,6 @@ import { useTimelineInteractionState, } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import ClearIcon from "@mui/icons-material/Clear"; -import SearchIcon from "@mui/icons-material/Search"; -import { - AppBar, - CircularProgress, - IconButton, - InputAdornment, - TextField, - Typography, -} from "@mui/material"; -import { useCallback, useMemo } from "react"; -import { makeStyles } from "tss-react/mui"; import { EventView } from "./EventView"; diff --git a/packages/suite-base/src/components/ExpandingToolbar.tsx b/packages/suite-base/src/components/ExpandingToolbar.tsx index 794ea42f72..8a789a0ccb 100644 --- a/packages/suite-base/src/components/ExpandingToolbar.tsx +++ b/packages/suite-base/src/components/ExpandingToolbar.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ArrowMinimize20Filled } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; import { Paper, IconButton, Tabs, Tab, tabClasses, tabsClasses, Tooltip } from "@mui/material"; import { ReactElement, ReactNode } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const PANE_HEIGHT = 240; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/ExperimentalFeatureSettings.stories.tsx b/packages/suite-base/src/components/ExperimentalFeatureSettings.stories.tsx index d3caab0e65..0508f3845f 100644 --- a/packages/suite-base/src/components/ExperimentalFeatureSettings.stories.tsx +++ b/packages/suite-base/src/components/ExperimentalFeatureSettings.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; +import { useState } from "react"; + import { ExperimentalFeatureSettings } from "@lichtblick/suite-base/components/ExperimentalFeatureSettings"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { StoryObj } from "@storybook/react"; -import { useState } from "react"; export default { title: "components/ExperimentalFeatureSettings", diff --git a/packages/suite-base/src/components/ExperimentalFeatureSettings.tsx b/packages/suite-base/src/components/ExperimentalFeatureSettings.tsx index 4fcf07b6ff..d204b06fa9 100644 --- a/packages/suite-base/src/components/ExperimentalFeatureSettings.tsx +++ b/packages/suite-base/src/components/ExperimentalFeatureSettings.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Checkbox, FormControlLabel, Typography } from "@mui/material"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import Stack from "@lichtblick/suite-base/components/Stack"; import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import { Checkbox, FormControlLabel, Typography } from "@mui/material"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()({ checkbox: { diff --git a/packages/suite-base/src/components/ExtensionDetails.stories.tsx b/packages/suite-base/src/components/ExtensionDetails.stories.tsx index e37545df1f..389e304e5e 100644 --- a/packages/suite-base/src/components/ExtensionDetails.stories.tsx +++ b/packages/suite-base/src/components/ExtensionDetails.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; +import { useState } from "react"; + import { ExtensionDetails } from "@lichtblick/suite-base/components/ExtensionDetails"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import ExtensionMarketplaceContext, { @@ -20,8 +26,6 @@ import ExtensionMarketplaceContext, { import ExtensionCatalogProvider from "@lichtblick/suite-base/providers/ExtensionCatalogProvider"; import { ExtensionLoader } from "@lichtblick/suite-base/services/ExtensionLoader"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { StoryObj } from "@storybook/react"; -import { useState } from "react"; export default { title: "components/ExtensionDetails", diff --git a/packages/suite-base/src/components/ExtensionDetails.tsx b/packages/suite-base/src/components/ExtensionDetails.tsx index 54455e2ef2..4d6cf1cc3a 100644 --- a/packages/suite-base/src/components/ExtensionDetails.tsx +++ b/packages/suite-base/src/components/ExtensionDetails.tsx @@ -1,7 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; +import { Button, Link, Tab, Tabs, Typography, Divider } from "@mui/material"; +import { useSnackbar } from "notistack"; +import { useCallback, useState } from "react"; +import { useAsync, useMountedState } from "react-use"; +import { makeStyles } from "tss-react/mui"; + import { Immutable } from "@lichtblick/suite"; import Stack from "@lichtblick/suite-base/components/Stack"; import TextContent from "@lichtblick/suite-base/components/TextContent"; @@ -13,12 +23,6 @@ import { } from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; -import { Button, Link, Tab, Tabs, Typography, Divider } from "@mui/material"; -import { useSnackbar } from "notistack"; -import { useCallback, useState } from "react"; -import { useAsync, useMountedState } from "react-use"; -import { makeStyles } from "tss-react/mui"; type Props = { installed: boolean; diff --git a/packages/suite-base/src/components/ExtensionsSettings/index.stories.tsx b/packages/suite-base/src/components/ExtensionsSettings/index.stories.tsx index 91779198f3..7997a90f8b 100644 --- a/packages/suite-base/src/components/ExtensionsSettings/index.stories.tsx +++ b/packages/suite-base/src/components/ExtensionsSettings/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; +import { useState } from "react"; + +import { ExtensionInfo, ExtensionLoader } from "@lichtblick/suite-base"; import ExtensionsSettings from "@lichtblick/suite-base/components/ExtensionsSettings"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import ExtensionMarketplaceContext, { @@ -18,10 +25,6 @@ import ExtensionMarketplaceContext, { } from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; import ExtensionCatalogProvider from "@lichtblick/suite-base/providers/ExtensionCatalogProvider"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { StoryObj } from "@storybook/react"; -import { useState } from "react"; - -import { ExtensionInfo, ExtensionLoader } from "@lichtblick/suite-base"; export default { title: "components/ExtensionsSettings", diff --git a/packages/suite-base/src/components/ExtensionsSettings/index.tsx b/packages/suite-base/src/components/ExtensionsSettings/index.tsx index f9d095a91f..85ec132575 100644 --- a/packages/suite-base/src/components/ExtensionsSettings/index.tsx +++ b/packages/suite-base/src/components/ExtensionsSettings/index.tsx @@ -1,16 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; -import { Immutable } from "@lichtblick/suite"; -import { ExtensionDetails } from "@lichtblick/suite-base/components/ExtensionDetails"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useExtensionCatalog } from "@lichtblick/suite-base/context/ExtensionCatalogContext"; -import { - ExtensionMarketplaceDetail, - useExtensionMarketplace, -} from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; import { Alert, AlertTitle, @@ -26,6 +20,16 @@ import { useEffect, useMemo, useState } from "react"; import { useAsyncFn } from "react-use"; import { makeStyles } from "tss-react/mui"; +import Log from "@lichtblick/log"; +import { Immutable } from "@lichtblick/suite"; +import { ExtensionDetails } from "@lichtblick/suite-base/components/ExtensionDetails"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useExtensionCatalog } from "@lichtblick/suite-base/context/ExtensionCatalogContext"; +import { + ExtensionMarketplaceDetail, + useExtensionMarketplace, +} from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; + const log = Log.getLogger(__filename); const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/ForwardAnalyticsContextProvider.tsx b/packages/suite-base/src/components/ForwardAnalyticsContextProvider.tsx index 70157cbab0..0c564ba318 100644 --- a/packages/suite-base/src/components/ForwardAnalyticsContextProvider.tsx +++ b/packages/suite-base/src/components/ForwardAnalyticsContextProvider.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useContext, useEffect, useLayoutEffect, useState } from "react"; +import { StoreApi, createStore, useStore } from "zustand"; + import { useMustNotChange } from "@lichtblick/hooks"; import AnalyticsContext from "@lichtblick/suite-base/context/AnalyticsContext"; import IAnalytics from "@lichtblick/suite-base/services/IAnalytics"; -import { useContext, useEffect, useLayoutEffect, useState } from "react"; -import { StoreApi, createStore, useStore } from "zustand"; export type ForwardedAnalytics = StoreApi<{ value: IAnalytics }>; diff --git a/packages/suite-base/src/components/GlobalCss.tsx b/packages/suite-base/src/components/GlobalCss.tsx index ba2f2170c4..beb9ebd03a 100644 --- a/packages/suite-base/src/components/GlobalCss.tsx +++ b/packages/suite-base/src/components/GlobalCss.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/HighlightChars.tsx b/packages/suite-base/src/components/HighlightChars.tsx index cb82991aee..310d2cc642 100644 --- a/packages/suite-base/src/components/HighlightChars.tsx +++ b/packages/suite-base/src/components/HighlightChars.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/HighlightedText.tsx b/packages/suite-base/src/components/HighlightedText.tsx index f29dafcb72..cab508ede2 100644 --- a/packages/suite-base/src/components/HighlightedText.tsx +++ b/packages/suite-base/src/components/HighlightedText.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/HoverableIconButton.tsx b/packages/suite-base/src/components/HoverableIconButton.tsx index aca67db23c..c8bc7e68e6 100644 --- a/packages/suite-base/src/components/HoverableIconButton.tsx +++ b/packages/suite-base/src/components/HoverableIconButton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/JsonInput.tsx b/packages/suite-base/src/components/JsonInput.tsx index dd25ab4f55..c1efdb47be 100644 --- a/packages/suite-base/src/components/JsonInput.tsx +++ b/packages/suite-base/src/components/JsonInput.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Stack from "@lichtblick/suite-base/components/Stack"; -import { validationErrorToString, ValidationResult } from "@lichtblick/suite-base/util/validators"; import ErrorIcon from "@mui/icons-material/Error"; import { Typography } from "@mui/material"; import CodeEditor from "@uiw/react-textarea-code-editor"; import * as _ from "lodash-es"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { validationErrorToString, ValidationResult } from "@lichtblick/suite-base/util/validators"; + const { useState, useCallback, useRef, useLayoutEffect, useEffect } = React; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/JsonTree/useGetItemStringWithTimezone.tsx b/packages/suite-base/src/components/JsonTree/useGetItemStringWithTimezone.tsx index f34f6cd5b3..07242c5134 100644 --- a/packages/suite-base/src/components/JsonTree/useGetItemStringWithTimezone.tsx +++ b/packages/suite-base/src/components/JsonTree/useGetItemStringWithTimezone.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { ReactNode, useCallback } from "react"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; import { getItemString } from "@lichtblick/suite-base/util/getItemString"; -import { ReactNode, useCallback } from "react"; export default function useGetItemStringWithTimezone(): ( type: string, diff --git a/packages/suite-base/src/components/KeyListener.tsx b/packages/suite-base/src/components/KeyListener.tsx index bed0e4c11d..f4e5a808cf 100644 --- a/packages/suite-base/src/components/KeyListener.tsx +++ b/packages/suite-base/src/components/KeyListener.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/LayoutBrowser/LayoutRow.tsx b/packages/suite-base/src/components/LayoutBrowser/LayoutRow.tsx index a49c9fb6b0..fa6a8b45b4 100644 --- a/packages/suite-base/src/components/LayoutBrowser/LayoutRow.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/LayoutRow.tsx @@ -1,12 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -/* eslint-disable @foxglove/no-restricted-imports */ +/* eslint-disable @lichtblick/no-restricted-imports */ -import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerContext"; -import { useConfirm } from "@lichtblick/suite-base/hooks/useConfirm"; -import { Layout, layoutIsShared } from "@lichtblick/suite-base/services/ILayoutStorage"; import ErrorIcon from "@mui/icons-material/Error"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import { @@ -33,6 +33,10 @@ import { } from "react"; import { useMountedState } from "react-use"; +import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerContext"; +import { useConfirm } from "@lichtblick/suite-base/hooks/useConfirm"; +import { Layout, layoutIsShared } from "@lichtblick/suite-base/services/ILayoutStorage"; + const StyledListItem = muiStyled(ListItem, { shouldForwardProp: (prop) => prop !== "hasModifications" && prop !== "deletedOnServer" && prop !== "editingName", diff --git a/packages/suite-base/src/components/LayoutBrowser/LayoutSection.tsx b/packages/suite-base/src/components/LayoutBrowser/LayoutSection.tsx index 346bfa2025..947862e68f 100644 --- a/packages/suite-base/src/components/LayoutBrowser/LayoutSection.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/LayoutSection.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; import { Typography, List } from "@mui/material"; import { MouseEvent } from "react"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; + import LayoutRow from "./LayoutRow"; export default function LayoutSection({ diff --git a/packages/suite-base/src/components/LayoutBrowser/SignInPrompt.tsx b/packages/suite-base/src/components/LayoutBrowser/SignInPrompt.tsx index 1ae6162a24..0fd57ceabe 100644 --- a/packages/suite-base/src/components/LayoutBrowser/SignInPrompt.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/SignInPrompt.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import CloseIcon from "@mui/icons-material/Close"; +import { ButtonBase, IconButton, Link, Typography } from "@mui/material"; +import { makeStyles } from "tss-react/mui"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { useCurrentUser } from "@lichtblick/suite-base/context/CurrentUserContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; -import CloseIcon from "@mui/icons-material/Close"; -import { ButtonBase, IconButton, Link, Typography } from "@mui/material"; -import { makeStyles } from "tss-react/mui"; type SignInPromptProps = { onDismiss?: () => void; diff --git a/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.stories.tsx b/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.stories.tsx index 7e422b5eed..884364edb2 100644 --- a/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.stories.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { action } from "@storybook/addon-actions"; +import { StoryObj } from "@storybook/react"; + import { UnsavedChangesPrompt } from "@lichtblick/suite-base/components/LayoutBrowser/UnsavedChangesPrompt"; import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { defaultPlaybackConfig } from "@lichtblick/suite-base/providers/CurrentLayoutProvider/reducers"; import { Layout, ISO8601Timestamp } from "@lichtblick/suite-base/services/ILayoutStorage"; -import { action } from "@storybook/addon-actions"; -import { StoryObj } from "@storybook/react"; export default { title: "components/LayoutBrowser/UnsavedChangesPrompt", diff --git a/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.tsx b/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.tsx index 0d0f89327e..b5b3c7819b 100644 --- a/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/UnsavedChangesPrompt.tsx @@ -1,10 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerContext"; -import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; import { Button, Dialog, @@ -20,6 +20,10 @@ import { import { ChangeEvent, useCallback, useLayoutEffect, useMemo, useRef, useState } from "react"; import { useLatest, useUnmount } from "react-use"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useLayoutManager } from "@lichtblick/suite-base/context/LayoutManagerContext"; +import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; + type UnsavedChangesResolution = | { type: "cancel" } | { type: "discard" } diff --git a/packages/suite-base/src/components/LayoutBrowser/index.stories.tsx b/packages/suite-base/src/components/LayoutBrowser/index.stories.tsx index 022ae4b159..46f08acf9c 100644 --- a/packages/suite-base/src/components/LayoutBrowser/index.stories.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/index.stories.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj, StoryContext, StoryFn } from "@storybook/react"; +import { fireEvent, screen, userEvent, within } from "@storybook/testing-library"; +import { useMemo, useState } from "react"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; @@ -17,9 +24,6 @@ import { ISO8601Timestamp, Layout } from "@lichtblick/suite-base/services/ILayou import LayoutManager from "@lichtblick/suite-base/services/LayoutManager/LayoutManager"; import MockLayoutStorage from "@lichtblick/suite-base/services/MockLayoutStorage"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { StoryObj, StoryContext, StoryFn } from "@storybook/react"; -import { fireEvent, screen, userEvent, within } from "@storybook/testing-library"; -import { useMemo, useState } from "react"; import LayoutBrowser from "./index"; diff --git a/packages/suite-base/src/components/LayoutBrowser/index.tsx b/packages/suite-base/src/components/LayoutBrowser/index.tsx index e3f0064879..5d2abed1d4 100644 --- a/packages/suite-base/src/components/LayoutBrowser/index.tsx +++ b/packages/suite-base/src/components/LayoutBrowser/index.tsx @@ -1,7 +1,31 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import AddIcon from "@mui/icons-material/Add"; +import CloudOffIcon from "@mui/icons-material/CloudOff"; +import FileOpenOutlinedIcon from "@mui/icons-material/FileOpenOutlined"; +import { + CircularProgress, + Divider, + IconButton, + List, + ListItem, + ListItemButton, + ListItemText, +} from "@mui/material"; +import * as _ from "lodash-es"; +import moment from "moment"; +import { useSnackbar } from "notistack"; +import path from "path"; +import { MouseEvent, useCallback, useEffect, useLayoutEffect, useMemo } from "react"; +import { useMountedState } from "react-use"; +import useAsyncFn from "react-use/lib/useAsyncFn"; +import { makeStyles } from "tss-react/mui"; + import Logger from "@lichtblick/log"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import SignInPrompt from "@lichtblick/suite-base/components/LayoutBrowser/SignInPrompt"; @@ -27,26 +51,6 @@ import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import { Layout, layoutIsShared } from "@lichtblick/suite-base/services/ILayoutStorage"; import { downloadTextFile } from "@lichtblick/suite-base/util/download"; import showOpenFilePicker from "@lichtblick/suite-base/util/showOpenFilePicker"; -import AddIcon from "@mui/icons-material/Add"; -import CloudOffIcon from "@mui/icons-material/CloudOff"; -import FileOpenOutlinedIcon from "@mui/icons-material/FileOpenOutlined"; -import { - CircularProgress, - Divider, - IconButton, - List, - ListItem, - ListItemButton, - ListItemText, -} from "@mui/material"; -import * as _ from "lodash-es"; -import moment from "moment"; -import { useSnackbar } from "notistack"; -import path from "path"; -import { MouseEvent, useCallback, useEffect, useLayoutEffect, useMemo } from "react"; -import { useMountedState } from "react-use"; -import useAsyncFn from "react-use/lib/useAsyncFn"; -import { makeStyles } from "tss-react/mui"; import LayoutSection from "./LayoutSection"; import { useLayoutBrowserReducer } from "./reducer"; diff --git a/packages/suite-base/src/components/LayoutBrowser/reducer.ts b/packages/suite-base/src/components/LayoutBrowser/reducer.ts index e79e092dcb..fae782923f 100644 --- a/packages/suite-base/src/components/LayoutBrowser/reducer.ts +++ b/packages/suite-base/src/components/LayoutBrowser/reducer.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; import * as _ from "lodash-es"; import { Dispatch } from "react"; import { useImmerReducer } from "use-immer"; +import { Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; + type MultiAction = "delete" | "duplicate" | "revert" | "save"; type State = { diff --git a/packages/suite-base/src/components/LichtblickLogo.tsx b/packages/suite-base/src/components/LichtblickLogo.tsx index 5b42afd710..08ad5c9b45 100644 --- a/packages/suite-base/src/components/LichtblickLogo.tsx +++ b/packages/suite-base/src/components/LichtblickLogo.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/LichtblickLogoText.tsx b/packages/suite-base/src/components/LichtblickLogoText.tsx index f8bfb8d580..caebc1fb02 100644 --- a/packages/suite-base/src/components/LichtblickLogoText.tsx +++ b/packages/suite-base/src/components/LichtblickLogoText.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MemoryUseIndicator.tsx b/packages/suite-base/src/components/MemoryUseIndicator.tsx index 343e24d11b..0f0c62281e 100644 --- a/packages/suite-base/src/components/MemoryUseIndicator.tsx +++ b/packages/suite-base/src/components/MemoryUseIndicator.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Tooltip, Typography } from "@mui/material"; +import { makeStyles } from "tss-react/mui"; + import { useMemoryInfo } from "@lichtblick/hooks"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; -import { Tooltip, Typography } from "@mui/material"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ root: { diff --git a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.stories.tsx b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.stories.tsx index 43609900b4..b59ffb536f 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.stories.tsx +++ b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { basicDatatypes } from "@lichtblick/suite-base/util/basicDatatypes"; import { Stack } from "@mui/material"; import { StoryObj } from "@storybook/react"; import { fireEvent, screen, userEvent, waitFor, within } from "@storybook/testing-library"; import { useState } from "react"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import { basicDatatypes } from "@lichtblick/suite-base/util/basicDatatypes"; + import MessagePathInput from "./MessagePathInput"; import { MessagePathInputStoryFixture } from "./fixture"; diff --git a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.test.ts b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.test.ts index a4539db86d..50f7e96f16 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.test.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.tsx b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.tsx index 9dabd307aa..a497d6cbff 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.tsx +++ b/packages/suite-base/src/components/MessagePathSyntax/MessagePathInput.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,23 +14,23 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { filterMap } from "@lichtblick/den/collection"; -import * as PanelAPI from "@lichtblick/suite-base/PanelAPI"; -import { Autocomplete, IAutocomplete } from "@lichtblick/suite-base/components/Autocomplete"; -import useGlobalVariables, { - GlobalVariables, -} from "@lichtblick/suite-base/hooks/useGlobalVariables"; -import { TextFieldProps } from "@mui/material"; -import * as _ from "lodash-es"; -import { CSSProperties, useCallback, useMemo } from "react"; -import { makeStyles } from "tss-react/mui"; - import { quoteTopicNameIfNeeded, parseMessagePath, MessagePath, PrimitiveType, } from "@foxglove/message-path"; +import { TextFieldProps } from "@mui/material"; +import * as _ from "lodash-es"; +import { CSSProperties, useCallback, useMemo } from "react"; +import { makeStyles } from "tss-react/mui"; + +import { filterMap } from "@lichtblick/den/collection"; +import * as PanelAPI from "@lichtblick/suite-base/PanelAPI"; +import { Autocomplete, IAutocomplete } from "@lichtblick/suite-base/components/Autocomplete"; +import useGlobalVariables, { + GlobalVariables, +} from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { traverseStructure, diff --git a/packages/suite-base/src/components/MessagePathSyntax/filterMatches.ts b/packages/suite-base/src/components/MessagePathSyntax/filterMatches.ts index bb36580c1b..0c01b1a92d 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/filterMatches.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/filterMatches.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; - import { MessagePathFilter } from "@foxglove/message-path"; +import { Immutable } from "@lichtblick/suite"; + export function filterMatches(filter: Immutable, value: unknown): boolean { if (typeof filter.value === "object") { throw new Error("filterMatches only works on paths where global variables have been filled in"); @@ -27,6 +30,6 @@ export function filterMatches(filter: Immutable, value: unkno // Test equality using `==` so we can be forgiving for comparing booleans with integers, // comparing numbers with strings, bigints with numbers, and so on. - // eslint-disable-next-line @foxglove/strict-equality + // eslint-disable-next-line @lichtblick/strict-equality return currentValue != undefined && currentValue == filter.value; } diff --git a/packages/suite-base/src/components/MessagePathSyntax/fixture.ts b/packages/suite-base/src/components/MessagePathSyntax/fixture.ts index f750f825f7..a2d0caf0c4 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/fixture.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/fixture.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.test.ts b/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.test.ts index 696f2b230d..2fdc6d465d 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.test.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.ts b/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.ts index ed7a3134d0..1976044d58 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/isTypicalFilterName.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.test.ts b/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.test.ts index ba8a962a6e..03c702ca98 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.test.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { parseMessagePath } from "@foxglove/message-path"; + import { unwrap } from "@lichtblick/den/monads"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { parseMessagePath } from "@foxglove/message-path"; - import { traverseStructure, messagePathsForStructure, diff --git a/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.ts b/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.ts index ab0800acc3..faef99ccff 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/messagePathsForDatatype.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,13 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { Immutable } from "@lichtblick/suite"; -import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { assertNever } from "@lichtblick/suite-base/util/assertNever"; -import naturalSort from "@lichtblick/suite-base/util/naturalSort"; -import * as _ from "lodash-es"; - import { MessagePathFilter, quoteFieldNameIfNeeded, @@ -26,6 +22,13 @@ import { MessagePathStructureItem, MessagePathStructureItemMessage, } from "@foxglove/message-path"; +import * as _ from "lodash-es"; + +import { Immutable } from "@lichtblick/suite"; +import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; +import { assertNever } from "@lichtblick/suite-base/util/assertNever"; +import naturalSort from "@lichtblick/suite-base/util/naturalSort"; const STRUCTURE_ITEM_INTEGER_TYPES = [ "int8", diff --git a/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.test.ts b/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.test.ts index 6958c752ac..def1a1f132 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.test.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.test.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; - import { parseMessagePath } from "@foxglove/message-path"; +import { MessageEvent } from "@lichtblick/suite"; + import { simpleGetMessagePathDataItems } from "./simpleGetMessagePathDataItems"; describe("simpleGetMessagePathDataItems", () => { diff --git a/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.ts b/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.ts index 050fb855c1..220dbf8f87 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/simpleGetMessagePathDataItems.ts @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; + import { Immutable } from "@lichtblick/suite"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { isTypedArray } from "@lichtblick/suite-base/types/isTypedArray"; -import { MessagePath } from "@foxglove/message-path"; - import { filterMatches } from "./filterMatches"; /** diff --git a/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.test.ts b/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.test.ts index 3a170b3f6f..9e56adc03f 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.test.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.test.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { fillInGlobalVariablesInPath } from "@lichtblick/suite-base/components/MessagePathSyntax/useCachedGetMessagePathDataItems"; - import { parseMessagePath } from "@foxglove/message-path"; +import { fillInGlobalVariablesInPath } from "@lichtblick/suite-base/components/MessagePathSyntax/useCachedGetMessagePathDataItems"; + import { stringifyMessagePath } from "./stringifyRosPath"; describe("stringifyRosPath", () => { diff --git a/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.ts b/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.ts index 024d5f1687..4fa0b8bbbe 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/stringifyRosPath.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; - import { MessagePathFilter, MessagePathPart, MessagePath } from "@foxglove/message-path"; +import { Immutable } from "@lichtblick/suite"; + type SlicePart = number | { variableName: string; startLoc: number }; type Slice = { diff --git a/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.test.tsx b/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.test.tsx index 7b3e08435f..43ee961dcc 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.test.tsx +++ b/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,16 +15,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { parseMessagePath } from "@foxglove/message-path"; +import { renderHook } from "@testing-library/react"; +import * as _ from "lodash-es"; + import { messagePathStructures } from "@lichtblick/suite-base/components/MessagePathSyntax/messagePathsForDatatype"; import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { MessageEvent, Topic } from "@lichtblick/suite-base/players/types"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { enumValuesByDatatypeAndField } from "@lichtblick/suite-base/util/enums"; -import { renderHook } from "@testing-library/react"; -import * as _ from "lodash-es"; - -import { parseMessagePath } from "@foxglove/message-path"; import { fillInGlobalVariablesInPath, diff --git a/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.ts b/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.ts index 4fdc5cb6f2..63919bf8db 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/useCachedGetMessagePathDataItems.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { + quoteTopicNameIfNeeded, + parseMessagePath, + MessagePathStructureItem, + MessagePathStructureItemMessage, + MessagePath, +} from "@foxglove/message-path"; +import * as _ from "lodash-es"; +import { useCallback, useMemo } from "react"; + import { filterMap } from "@lichtblick/den/collection"; import { useDeepMemo, useShallowMemo } from "@lichtblick/hooks"; import { Immutable } from "@lichtblick/suite"; @@ -24,16 +37,6 @@ import { enumValuesByDatatypeAndField, extractTypeFromStudioEnumAnnotation, } from "@lichtblick/suite-base/util/enums"; -import * as _ from "lodash-es"; -import { useCallback, useMemo } from "react"; - -import { - quoteTopicNameIfNeeded, - parseMessagePath, - MessagePathStructureItem, - MessagePathStructureItemMessage, - MessagePath, -} from "@foxglove/message-path"; import { filterMatches } from "./filterMatches"; import { TypicalFilterNames } from "./isTypicalFilterName"; diff --git a/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.test.tsx b/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.test.tsx index 8e96415ba7..d82aae97a7 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.test.tsx +++ b/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,11 +15,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook } from "@testing-library/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { MessageEvent, Topic } from "@lichtblick/suite-base/players/types"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { renderHook } from "@testing-library/react"; import { useMessageDataItem } from "./useMessageDataItem"; diff --git a/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.ts b/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.ts index 6e20bc71c3..e6b8d14b13 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/useMessageDataItem.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useCallback, useMemo } from "react"; + import { useMessageReducer } from "@lichtblick/suite-base/PanelAPI"; import { subscribePayloadFromMessagePath } from "@lichtblick/suite-base/players/subscribePayloadFromMessagePath"; import { MessageEvent, SubscribePayload } from "@lichtblick/suite-base/players/types"; -import { useCallback, useMemo } from "react"; import { MessageAndData, diff --git a/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.test.tsx b/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.test.tsx index 5c2abdea1e..cc05befb64 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.test.tsx +++ b/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,6 +15,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { act, renderHook } from "@testing-library/react"; +import React, { PropsWithChildren } from "react"; + import useMessagesByPath from "@lichtblick/suite-base/components/MessagePathSyntax/useMessagesByPath"; import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import useGlobalVariables, { @@ -20,8 +26,6 @@ import useGlobalVariables, { import { PlayerStateActiveData, Topic, MessageEvent } from "@lichtblick/suite-base/players/types"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { act, renderHook } from "@testing-library/react"; -import React, { PropsWithChildren } from "react"; import * as fixture from "./fixture"; diff --git a/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.ts b/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.ts index 27e2b2a9cc..ecf7e70bfb 100644 --- a/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.ts +++ b/packages/suite-base/src/components/MessagePathSyntax/useMessagesByPath.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useMemo } from "react"; + import { filterMap } from "@lichtblick/den/collection"; import { useShallowMemo } from "@lichtblick/hooks"; import * as PanelAPI from "@lichtblick/suite-base/PanelAPI"; @@ -19,7 +24,6 @@ import { useDecodeMessagePathsForMessagesByTopic, } from "@lichtblick/suite-base/components/MessagePathSyntax/useCachedGetMessagePathDataItems"; import { subscribePayloadFromMessagePath } from "@lichtblick/suite-base/players/subscribePayloadFromMessagePath"; -import { useMemo } from "react"; // Given a set of message paths, subscribe to the appropriate topics and return // messages with their queried data decoded for each path. diff --git a/packages/suite-base/src/components/MessagePipeline/FakePlayer.ts b/packages/suite-base/src/components/MessagePipeline/FakePlayer.ts index b6095df643..291cd16d66 100644 --- a/packages/suite-base/src/components/MessagePipeline/FakePlayer.ts +++ b/packages/suite-base/src/components/MessagePipeline/FakePlayer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.test.ts b/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.test.ts index 5af9262441..d813fcbf30 100644 --- a/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.test.ts +++ b/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.ts b/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.ts index 15a5c4d666..07d42194bc 100644 --- a/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.ts +++ b/packages/suite-base/src/components/MessagePipeline/MessageOrderTracker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Time, isLessThan, subtract as subtractTimes, toSec } from "@foxglove/rostime"; + import Logger from "@lichtblick/log"; import { PlayerState, MessageEvent, PlayerProblem } from "@lichtblick/suite-base/players/types"; import { formatFrame } from "@lichtblick/suite-base/util/time"; -import { Time, isLessThan, subtract as subtractTimes, toSec } from "@foxglove/rostime"; - const DRIFT_THRESHOLD_SEC = 1; // Maximum amount of drift allowed. const WAIT_FOR_SEEK_SEC = 1; // How long we wait for a change in `lastSeekTime` before warning. diff --git a/packages/suite-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx b/packages/suite-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx index 68cb9819f7..540269dc45 100644 --- a/packages/suite-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx +++ b/packages/suite-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Time, isLessThan } from "@foxglove/rostime"; +import { Immutable } from "immer"; +import * as _ from "lodash-es"; +import { MutableRefObject, useEffect, useMemo, useRef, useState } from "react"; +import shallowequal from "shallowequal"; +import { Writable } from "ts-essentials"; +import { createStore } from "zustand"; + import { Condvar } from "@lichtblick/den/async"; import { Metadata, ParameterValue } from "@lichtblick/suite"; import { @@ -35,14 +46,6 @@ import { TopicStats, } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { Immutable } from "immer"; -import * as _ from "lodash-es"; -import { MutableRefObject, useEffect, useMemo, useRef, useState } from "react"; -import shallowequal from "shallowequal"; -import { Writable } from "ts-essentials"; -import { createStore } from "zustand"; - -import { Time, isLessThan } from "@foxglove/rostime"; import { ContextInternal } from "./index"; import { MessagePipelineInternalState, MessagePipelineStateAction, reducer } from "./store"; diff --git a/packages/suite-base/src/components/MessagePipeline/index.test.tsx b/packages/suite-base/src/components/MessagePipeline/index.test.tsx index ca94490ec0..40bb4b5963 100644 --- a/packages/suite-base/src/components/MessagePipeline/index.test.tsx +++ b/packages/suite-base/src/components/MessagePipeline/index.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -14,6 +17,10 @@ /* eslint-disable jest/no-conditional-expect */ +import { act, renderHook } from "@testing-library/react"; +import { PropsWithChildren, useCallback, useState } from "react"; +import { DeepPartial } from "ts-essentials"; + import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import { Player, @@ -24,9 +31,6 @@ import { import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import delay from "@lichtblick/suite-base/util/delay"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { act, renderHook } from "@testing-library/react"; -import { PropsWithChildren, useCallback, useState } from "react"; -import { DeepPartial } from "ts-essentials"; import { MessagePipelineContext, MessagePipelineProvider, useMessagePipeline } from "."; import FakePlayer from "./FakePlayer"; diff --git a/packages/suite-base/src/components/MessagePipeline/index.tsx b/packages/suite-base/src/components/MessagePipeline/index.tsx index 1a656314c1..2cc7e5a2b4 100644 --- a/packages/suite-base/src/components/MessagePipeline/index.tsx +++ b/packages/suite-base/src/components/MessagePipeline/index.tsx @@ -1,7 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { + createContext, + useCallback, + useContext, + useEffect, + useLayoutEffect, + useMemo, + useRef, +} from "react"; +import { StoreApi, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { Immutable } from "@lichtblick/suite"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; @@ -16,17 +31,6 @@ import { PlayerState, SubscribePayload, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; -import { - createContext, - useCallback, - useContext, - useEffect, - useLayoutEffect, - useMemo, - useRef, -} from "react"; -import { StoreApi, useStore } from "zustand"; import MessageOrderTracker from "./MessageOrderTracker"; import { pauseFrameForPromises, FramePromise } from "./pauseFrameForPromise"; diff --git a/packages/suite-base/src/components/MessagePipeline/pauseFrameForPromise.ts b/packages/suite-base/src/components/MessagePipeline/pauseFrameForPromise.ts index d238a96a3f..c38d0afce1 100644 --- a/packages/suite-base/src/components/MessagePipeline/pauseFrameForPromise.ts +++ b/packages/suite-base/src/components/MessagePipeline/pauseFrameForPromise.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePipeline/store.ts b/packages/suite-base/src/components/MessagePipeline/store.ts index 4c595a314e..26e3399b9b 100644 --- a/packages/suite-base/src/components/MessagePipeline/store.ts +++ b/packages/suite-base/src/components/MessagePipeline/store.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { MutableRefObject } from "react"; +import shallowequal from "shallowequal"; +import { createStore, StoreApi } from "zustand"; + import { Condvar } from "@lichtblick/den/async"; import { Immutable, MessageEvent } from "@lichtblick/suite"; import { @@ -17,10 +25,6 @@ import { SubscribePayload, } from "@lichtblick/suite-base/players/types"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import * as _ from "lodash-es"; -import { MutableRefObject } from "react"; -import shallowequal from "shallowequal"; -import { createStore, StoreApi } from "zustand"; import { FramePromise } from "./pauseFrameForPromise"; import { MessagePipelineContext } from "./types"; diff --git a/packages/suite-base/src/components/MessagePipeline/subscriptions.test.ts b/packages/suite-base/src/components/MessagePipeline/subscriptions.test.ts index 32589802d7..cd49619527 100644 --- a/packages/suite-base/src/components/MessagePipeline/subscriptions.test.ts +++ b/packages/suite-base/src/components/MessagePipeline/subscriptions.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MessagePipeline/subscriptions.ts b/packages/suite-base/src/components/MessagePipeline/subscriptions.ts index ff9f5ff5b2..4b265d8c31 100644 --- a/packages/suite-base/src/components/MessagePipeline/subscriptions.ts +++ b/packages/suite-base/src/components/MessagePipeline/subscriptions.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; -import { SubscribePayload } from "@lichtblick/suite-base/players/types"; import moize from "moize"; import * as R from "ramda"; +import { Immutable } from "@lichtblick/suite"; +import { SubscribePayload } from "@lichtblick/suite-base/players/types"; + /** * Create a deep equal memoized identify function. Used for stabilizing the subscription payloads we * send on to the player. diff --git a/packages/suite-base/src/components/MessagePipeline/types.ts b/packages/suite-base/src/components/MessagePipeline/types.ts index a942ff2ede..3b263a9a50 100644 --- a/packages/suite-base/src/components/MessagePipeline/types.ts +++ b/packages/suite-base/src/components/MessagePipeline/types.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; + import { Immutable, MessageEvent, Metadata, ParameterValue } from "@lichtblick/suite"; import { BuiltinPanelExtensionContext } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { @@ -13,8 +18,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { Time } from "@foxglove/rostime"; - type ResumeFrame = () => void; export type MessagePipelineContext = Immutable<{ playerState: PlayerState; diff --git a/packages/suite-base/src/components/MockPanelContextProvider.tsx b/packages/suite-base/src/components/MockPanelContextProvider.tsx index 97ce70e5b6..85568b577b 100644 --- a/packages/suite-base/src/components/MockPanelContextProvider.tsx +++ b/packages/suite-base/src/components/MockPanelContextProvider.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { ReactNode } from "react"; + import PanelContext, { PanelContextType } from "@lichtblick/suite-base/components/PanelContext"; import { PanelConfig } from "@lichtblick/suite-base/types/panels"; -import { ReactNode } from "react"; type MockProps = Partial>; const DEFAULT_MOCK_PANEL_CONTEXT: PanelContextType = { diff --git a/packages/suite-base/src/components/MosaicPathContext.ts b/packages/suite-base/src/components/MosaicPathContext.ts index 676ec42acc..8ac00828f8 100644 --- a/packages/suite-base/src/components/MosaicPathContext.ts +++ b/packages/suite-base/src/components/MosaicPathContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MultiProvider.tsx b/packages/suite-base/src/components/MultiProvider.tsx index 00c3b820f5..4cbf2e2940 100644 --- a/packages/suite-base/src/components/MultiProvider.tsx +++ b/packages/suite-base/src/components/MultiProvider.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/MultilineMiddleTruncate.tsx b/packages/suite-base/src/components/MultilineMiddleTruncate.tsx index c10da065fb..12e2d101fa 100644 --- a/packages/suite-base/src/components/MultilineMiddleTruncate.tsx +++ b/packages/suite-base/src/components/MultilineMiddleTruncate.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/NotificationModal.stories.tsx b/packages/suite-base/src/components/NotificationModal.stories.tsx index f9a617f0dc..745ccbefb4 100644 --- a/packages/suite-base/src/components/NotificationModal.stories.tsx +++ b/packages/suite-base/src/components/NotificationModal.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import NotificationModal from "@lichtblick/suite-base/components/NotificationModal"; import { StoryObj } from "@storybook/react"; +import NotificationModal from "@lichtblick/suite-base/components/NotificationModal"; + const fakeError = () => { const err = Error("This error is on purpose - it comes from the story"); diff --git a/packages/suite-base/src/components/NotificationModal.tsx b/packages/suite-base/src/components/NotificationModal.tsx index fa00a47bd4..ef4476547f 100644 --- a/packages/suite-base/src/components/NotificationModal.tsx +++ b/packages/suite-base/src/components/NotificationModal.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { NotificationMessage } from "@lichtblick/suite-base/util/sendNotification"; import CloseIcon from "@mui/icons-material/Close"; import { Dialog, DialogTitle, IconButton, Typography } from "@mui/material"; import { useMemo } from "react"; import { makeStyles } from "tss-react/mui"; +import { NotificationMessage } from "@lichtblick/suite-base/util/sendNotification"; + const useStyles = makeStyles()((theme) => ({ container: { alignItems: "stretch", diff --git a/packages/suite-base/src/components/Panel.test.tsx b/packages/suite-base/src/components/Panel.test.tsx index 0abe5729f4..4648645855 100644 --- a/packages/suite-base/src/components/Panel.test.tsx +++ b/packages/suite-base/src/components/Panel.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { render, renderHook, act } from "@testing-library/react"; +import { useEffect } from "react"; + import Panel from "@lichtblick/suite-base/components/Panel"; import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { PanelsActions } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { render, renderHook, act } from "@testing-library/react"; -import { useEffect } from "react"; type DummyConfig = { someString: string }; type DummyProps = { config: DummyConfig; saveConfig: (arg0: Partial) => void }; diff --git a/packages/suite-base/src/components/Panel.tsx b/packages/suite-base/src/components/Panel.tsx index 6b93664589..44af9d7000 100644 --- a/packages/suite-base/src/components/Panel.tsx +++ b/packages/suite-base/src/components/Panel.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -17,6 +20,31 @@ import { TabDesktopMultiple20Regular, TableSimple20Regular, } from "@fluentui/react-icons"; +import * as _ from "lodash-es"; +import React, { + ComponentType, + MouseEventHandler, + Profiler, + useCallback, + useContext, + useLayoutEffect, + useMemo, + useRef, + useState, +} from "react"; +import { + getNodeAtPath, + getOtherBranch, + MosaicContext, + MosaicNode, + MosaicWindowActions, + MosaicWindowContext, + updateTree, +} from "react-mosaic-component"; +import { Transition } from "react-transition-group"; +import { useMountedState } from "react-use"; +import { makeStyles } from "tss-react/mui"; + import { useShallowMemo } from "@lichtblick/hooks"; import { useConfigById } from "@lichtblick/suite-base/PanelAPI"; import KeyListener from "@lichtblick/suite-base/components/KeyListener"; @@ -45,30 +73,6 @@ import { getPathFromNode, updateTabPanelLayout, } from "@lichtblick/suite-base/util/layout"; -import * as _ from "lodash-es"; -import React, { - ComponentType, - MouseEventHandler, - Profiler, - useCallback, - useContext, - useLayoutEffect, - useMemo, - useRef, - useState, -} from "react"; -import { - getNodeAtPath, - getOtherBranch, - MosaicContext, - MosaicNode, - MosaicWindowActions, - MosaicWindowContext, - updateTree, -} from "react-mosaic-component"; -import { Transition } from "react-transition-group"; -import { useMountedState } from "react-use"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ perfInfo: { @@ -417,7 +421,7 @@ export default function Panel< ); const setHasFullscreenDescendant = useCallback( - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters (value: boolean) => { _setHasFullscreenDescendant(value); parentPanelContext?.setHasFullscreenDescendant(value); diff --git a/packages/suite-base/src/components/PanelCatalog/PanelCatalog.tsx b/packages/suite-base/src/components/PanelCatalog/PanelCatalog.tsx index b95504154b..f00e4c0c5e 100644 --- a/packages/suite-base/src/components/PanelCatalog/PanelCatalog.tsx +++ b/packages/suite-base/src/components/PanelCatalog/PanelCatalog.tsx @@ -1,11 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { PanelInfo, usePanelCatalog } from "@lichtblick/suite-base/context/PanelCatalogContext"; -import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; import CancelIcon from "@mui/icons-material/Cancel"; import SearchIcon from "@mui/icons-material/Search"; import { IconButton, InputAdornment, TextField } from "@mui/material"; @@ -15,6 +14,11 @@ import { forwardRef, useCallback, useEffect, useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { PanelInfo, usePanelCatalog } from "@lichtblick/suite-base/context/PanelCatalogContext"; +import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; + import { PanelGrid } from "./PanelGrid"; import { PanelList } from "./PanelList"; import { PanelSelection } from "./types"; diff --git a/packages/suite-base/src/components/PanelCatalog/PanelGrid.tsx b/packages/suite-base/src/components/PanelCatalog/PanelGrid.tsx index 727b5091f2..9ef28233b3 100644 --- a/packages/suite-base/src/components/PanelCatalog/PanelGrid.tsx +++ b/packages/suite-base/src/components/PanelCatalog/PanelGrid.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -6,11 +9,12 @@ // License, v2.0. If a copy of the MPL was not distributed with this // fil -import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; import { Container } from "@mui/material"; import { useCallback } from "react"; import { makeStyles } from "tss-react/mui"; +import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; + import { PanelGridCard } from "./PanelGridCard"; import { PanelSelection } from "./types"; diff --git a/packages/suite-base/src/components/PanelCatalog/PanelGridCard.tsx b/packages/suite-base/src/components/PanelCatalog/PanelGridCard.tsx index 59c71f8785..a07502f75e 100644 --- a/packages/suite-base/src/components/PanelCatalog/PanelGridCard.tsx +++ b/packages/suite-base/src/components/PanelCatalog/PanelGridCard.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import TextHighlight from "@lichtblick/suite-base/components/TextHighlight"; -import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; import { Card, CardActionArea, CardContent, CardMedia, Typography } from "@mui/material"; import { useCallback } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import TextHighlight from "@lichtblick/suite-base/components/TextHighlight"; +import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; + const useStyles = makeStyles()((theme) => { return { fullHeight: { diff --git a/packages/suite-base/src/components/PanelCatalog/PanelList.tsx b/packages/suite-base/src/components/PanelCatalog/PanelList.tsx index f49d223e0a..5be3f9ea53 100644 --- a/packages/suite-base/src/components/PanelCatalog/PanelList.tsx +++ b/packages/suite-base/src/components/PanelCatalog/PanelList.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { List } from "@mui/material"; +import { useCallback, useMemo } from "react"; + import { useCurrentLayoutActions, usePanelMosaicId, } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; -import { List } from "@mui/material"; -import { useCallback, useMemo } from "react"; import { PanelListItem, DropDescription } from "./PanelListItem"; import { PanelSelection } from "./types"; diff --git a/packages/suite-base/src/components/PanelCatalog/PanelListItem.tsx b/packages/suite-base/src/components/PanelCatalog/PanelListItem.tsx index 8eb2869b3b..2cfd654b12 100644 --- a/packages/suite-base/src/components/PanelCatalog/PanelListItem.tsx +++ b/packages/suite-base/src/components/PanelCatalog/PanelListItem.tsx @@ -1,12 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ReOrderDotsVertical16Filled } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import TextHighlight from "@lichtblick/suite-base/components/TextHighlight"; -import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; -import { MosaicDropResult, PanelConfig } from "@lichtblick/suite-base/types/panels"; import { Fade, ListItem, ListItemButton, ListItemText, Tooltip, Typography } from "@mui/material"; import { useCallback, useEffect, useRef } from "react"; import { useDrag } from "react-dnd"; @@ -14,6 +13,11 @@ import { MosaicDragType, MosaicPath } from "react-mosaic-component"; import { MosaicDropTargetPosition } from "react-mosaic-component/lib/internalTypes"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import TextHighlight from "@lichtblick/suite-base/components/TextHighlight"; +import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; +import { MosaicDropResult, PanelConfig } from "@lichtblick/suite-base/types/panels"; + const useStyles = makeStyles()((theme, _params, classes) => { return { listItemButton: { diff --git a/packages/suite-base/src/components/PanelCatalog/index.stories.tsx b/packages/suite-base/src/components/PanelCatalog/index.stories.tsx index fd60d4a7df..18367a81d8 100644 --- a/packages/suite-base/src/components/PanelCatalog/index.stories.tsx +++ b/packages/suite-base/src/components/PanelCatalog/index.stories.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useTheme } from "@mui/material"; +import { Meta, StoryFn, StoryObj } from "@storybook/react"; +import { userEvent } from "@storybook/testing-library"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelCatalog as PanelCatalogComponent } from "@lichtblick/suite-base/components/PanelCatalog"; import PanelCatalogContext, { @@ -9,11 +18,6 @@ import PanelCatalogContext, { PanelInfo, } from "@lichtblick/suite-base/context/PanelCatalogContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; -import { useTheme } from "@mui/material"; -import { Meta, StoryFn, StoryObj } from "@storybook/react"; -import { userEvent } from "@storybook/testing-library"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; const SamplePanel1 = () =>
; SamplePanel1.panelType = "sample"; diff --git a/packages/suite-base/src/components/PanelCatalog/index.ts b/packages/suite-base/src/components/PanelCatalog/index.ts index de3e912a99..0bfcf8a341 100644 --- a/packages/suite-base/src/components/PanelCatalog/index.ts +++ b/packages/suite-base/src/components/PanelCatalog/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelCatalog/types.ts b/packages/suite-base/src/components/PanelCatalog/types.ts index ba6d209fb4..e2a0a4d341 100644 --- a/packages/suite-base/src/components/PanelCatalog/types.ts +++ b/packages/suite-base/src/components/PanelCatalog/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelContext.ts b/packages/suite-base/src/components/PanelContext.ts index cce5b201ac..5bf785e7cf 100644 --- a/packages/suite-base/src/components/PanelContext.ts +++ b/packages/suite-base/src/components/PanelContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -32,7 +35,7 @@ export type PanelContextType = { isFullscreen: boolean; /** Used to adjust z-index settings on parent panels when children are fullscreen */ - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters setHasFullscreenDescendant: (hasFullscreenDescendant: boolean) => void; connectToolbarDragHandle?: (el: Element | ReactNull) => void; diff --git a/packages/suite-base/src/components/PanelContextMenu.stories.tsx b/packages/suite-base/src/components/PanelContextMenu.stories.tsx index 415e1e06f2..cfe39c46a9 100644 --- a/packages/suite-base/src/components/PanelContextMenu.stories.tsx +++ b/packages/suite-base/src/components/PanelContextMenu.stories.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { userEvent } from "@storybook/testing-library"; +import { useCallback } from "react"; +import { v4 as uuid } from "uuid"; + import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelContextMenu, @@ -9,10 +17,6 @@ import { } from "@lichtblick/suite-base/components/PanelContextMenu"; import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { userEvent } from "@storybook/testing-library"; -import { useCallback } from "react"; -import { v4 as uuid } from "uuid"; export default { title: "components/PanelContextMenu", diff --git a/packages/suite-base/src/components/PanelContextMenu.tsx b/packages/suite-base/src/components/PanelContextMenu.tsx index ce58a531fa..0ea9709036 100644 --- a/packages/suite-base/src/components/PanelContextMenu.tsx +++ b/packages/suite-base/src/components/PanelContextMenu.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; -import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; import { Divider, Menu, MenuItem } from "@mui/material"; import { useCallback, useEffect, useRef, useState } from "react"; +import { Immutable } from "@lichtblick/suite"; +import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; + /** * Types of items that can be included in a context menu. Either a clickable item * or a divider. diff --git a/packages/suite-base/src/components/PanelErrorBoundary.stories.tsx b/packages/suite-base/src/components/PanelErrorBoundary.stories.tsx index 21988df946..47cda87854 100644 --- a/packages/suite-base/src/components/PanelErrorBoundary.stories.tsx +++ b/packages/suite-base/src/components/PanelErrorBoundary.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelErrorBoundary.tsx b/packages/suite-base/src/components/PanelErrorBoundary.tsx index ca910f93dd..ac30ae67e2 100644 --- a/packages/suite-base/src/components/PanelErrorBoundary.tsx +++ b/packages/suite-base/src/components/PanelErrorBoundary.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Button, Link } from "@mui/material"; +import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { reportError } from "@lichtblick/suite-base/reportError"; import { AppError } from "@lichtblick/suite-base/util/errors"; -import { Button, Link } from "@mui/material"; -import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react"; import ErrorDisplay from "./ErrorDisplay"; diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.stories.tsx b/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.stories.tsx index 01fe65e333..e39649e94d 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.stories.tsx +++ b/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.tsx b/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.tsx index ea09b65276..e90001f880 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.tsx +++ b/packages/suite-base/src/components/PanelExtensionAdapter/PanelConfigVersionError.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.stories.tsx b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.stories.tsx index 63b76053a3..687070f010 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.stories.tsx +++ b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.stories.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toSec } from "@foxglove/rostime"; +import { StoryObj } from "@storybook/react"; +import { ReactElement, useLayoutEffect, useState } from "react"; +import ReactDOM from "react-dom"; + import { Immutable, PanelExtensionContext, @@ -12,11 +20,6 @@ import { import ErrorBoundary from "@lichtblick/suite-base/components/ErrorBoundary"; import MockPanelContextProvider from "@lichtblick/suite-base/components/MockPanelContextProvider"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { ReactElement, useLayoutEffect, useState } from "react"; -import ReactDOM from "react-dom"; - -import { toSec } from "@foxglove/rostime"; import PanelExtensionAdapter, { VERSION_CONFIG_KEY } from "./PanelExtensionAdapter"; diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.test.tsx b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.test.tsx index 5b3740447c..2deca80167 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.test.tsx +++ b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.test.tsx @@ -1,21 +1,24 @@ /** @jest-environment jsdom */ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /* eslint-disable jest/no-done-callback */ +import { Time } from "@foxglove/rostime"; +import { render } from "@testing-library/react"; +import { act } from "react-dom/test-utils"; + import { Condvar, signal } from "@lichtblick/den/async"; import { PanelExtensionContext, RenderState, MessageEvent, Immutable } from "@lichtblick/suite"; import MockPanelContextProvider from "@lichtblick/suite-base/components/MockPanelContextProvider"; import { AdvertiseOptions, PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import { render } from "@testing-library/react"; -import { act } from "react-dom/test-utils"; - -import { Time } from "@foxglove/rostime"; import PanelExtensionAdapter from "./PanelExtensionAdapter"; diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.tsx b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.tsx index 524d334068..e65ea29975 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.tsx +++ b/packages/suite-base/src/components/PanelExtensionAdapter/PanelExtensionAdapter.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec, toSec } from "@foxglove/rostime"; +import { useTheme } from "@mui/material"; +import { CSSProperties, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; +import { useLatest } from "react-use"; +import { v4 as uuid } from "uuid"; + import { useSynchronousMountedState, useValueChangedDebugLog } from "@lichtblick/hooks"; import Logger from "@lichtblick/log"; import { @@ -45,12 +54,6 @@ import { } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import { PanelConfig, SaveConfig } from "@lichtblick/suite-base/types/panels"; import { assertNever } from "@lichtblick/suite-base/util/assertNever"; -import { useTheme } from "@mui/material"; -import { CSSProperties, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; -import { useLatest } from "react-use"; -import { v4 as uuid } from "uuid"; - -import { fromSec, toSec } from "@foxglove/rostime"; import { PanelConfigVersionError } from "./PanelConfigVersionError"; import { initRenderStateBuilder } from "./renderState"; diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/index.ts b/packages/suite-base/src/components/PanelExtensionAdapter/index.ts index 5c87ac9946..9b9121a814 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/index.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.test.ts b/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.test.ts index 00ac5f7d17..2f919520fc 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.test.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.ts b/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.ts index 2ec7da9592..230f2ef0cd 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/messageProcessing.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { Opaque } from "ts-essentials"; + import { Immutable, MessageEvent, @@ -10,8 +16,6 @@ import { } from "@lichtblick/suite"; import { Topic as PlayerTopic } from "@lichtblick/suite-base/players/types"; import { ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; -import * as _ from "lodash-es"; -import { Opaque } from "ts-essentials"; // Branded string to ensure that users go through the `converterKey` function to compute a lookup key type ConverterKey = Opaque; diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/renderState.test.ts b/packages/suite-base/src/components/PanelExtensionAdapter/renderState.test.ts index 705812007f..6347eadfee 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/renderState.test.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/renderState.test.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PlayerPresence } from "@lichtblick/suite-base/players/types"; import { produce } from "immer"; +import { PlayerPresence } from "@lichtblick/suite-base/players/types"; + import { BuilderRenderStateInput, initRenderStateBuilder } from "./renderState"; function makeInitialState(): BuilderRenderStateInput { diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/renderState.ts b/packages/suite-base/src/components/PanelExtensionAdapter/renderState.ts index 53685c1bba..e4dcb864e9 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/renderState.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/renderState.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { compare, toSec } from "@foxglove/rostime"; +import memoizeWeak from "memoize-weak"; +import { Writable } from "ts-essentials"; + import { filterMap } from "@lichtblick/den/collection"; import { AppSettingValue, @@ -23,10 +30,6 @@ import { Topic as PlayerTopic, } from "@lichtblick/suite-base/players/types"; import { HoverValue } from "@lichtblick/suite-base/types/hoverValue"; -import memoizeWeak from "memoize-weak"; -import { Writable } from "ts-essentials"; - -import { compare, toSec } from "@foxglove/rostime"; import { collateTopicSchemaConversions, diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/types.ts b/packages/suite-base/src/components/PanelExtensionAdapter/types.ts index fb05bbbca9..30eacb2845 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/types.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelExtensionAdapter/useSharedPanelState.ts b/packages/suite-base/src/components/PanelExtensionAdapter/useSharedPanelState.ts index e30854fa8c..f73c60caa2 100644 --- a/packages/suite-base/src/components/PanelExtensionAdapter/useSharedPanelState.ts +++ b/packages/suite-base/src/components/PanelExtensionAdapter/useSharedPanelState.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback, useMemo } from "react"; + import { Immutable } from "@lichtblick/suite"; import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; import { @@ -11,7 +16,6 @@ import { useCurrentLayoutSelector, } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import { useCallback, useMemo } from "react"; const EmptySharedPanelState: Record = Object.freeze({}); const selectSharedState = (state: LayoutState) => state.sharedPanelState ?? EmptySharedPanelState; diff --git a/packages/suite-base/src/components/PanelLayout.stories.tsx b/packages/suite-base/src/components/PanelLayout.stories.tsx index 137b0a485e..0f62e3874b 100644 --- a/packages/suite-base/src/components/PanelLayout.stories.tsx +++ b/packages/suite-base/src/components/PanelLayout.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,15 +14,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Panel from "@lichtblick/suite-base/components/Panel"; -import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; -import { PanelCatalog, PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryObj } from "@storybook/react"; import { fireEvent, screen } from "@storybook/testing-library"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; +import Panel from "@lichtblick/suite-base/components/Panel"; +import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; +import { PanelCatalog, PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import PanelLayout from "./PanelLayout"; async function openPanelMenu(): Promise { diff --git a/packages/suite-base/src/components/PanelLayout.test.tsx b/packages/suite-base/src/components/PanelLayout.test.tsx index 74ac91100c..1e496c1763 100644 --- a/packages/suite-base/src/components/PanelLayout.test.tsx +++ b/packages/suite-base/src/components/PanelLayout.test.tsx @@ -1,8 +1,16 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { render, waitFor } from "@testing-library/react"; +import { useState } from "react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import Panel from "@lichtblick/suite-base/components/Panel"; import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; import PanelCatalogContext, { @@ -13,10 +21,6 @@ import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentL import { PanelStateContextProvider } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; -import { render, waitFor } from "@testing-library/react"; -import { useState } from "react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; import { UnconnectedPanelLayout } from "./PanelLayout"; diff --git a/packages/suite-base/src/components/PanelLayout.tsx b/packages/suite-base/src/components/PanelLayout.tsx index b67907678c..b698a8c771 100644 --- a/packages/suite-base/src/components/PanelLayout.tsx +++ b/packages/suite-base/src/components/PanelLayout.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,18 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { CircularProgress } from "@mui/material"; +import React, { PropsWithChildren, Suspense, useCallback, useMemo } from "react"; +import { useDrop } from "react-dnd"; +import { + MosaicDragType, + MosaicNode, + MosaicPath, + MosaicWindow, + MosaicWithoutDragDropContext, +} from "react-mosaic-component"; +import { makeStyles } from "tss-react/mui"; + import { EmptyPanelLayout } from "@lichtblick/suite-base/components/EmptyPanelLayout"; import EmptyState from "@lichtblick/suite-base/components/EmptyState"; import Stack from "@lichtblick/suite-base/components/Stack"; @@ -25,17 +40,6 @@ import { useExtensionCatalog } from "@lichtblick/suite-base/context/ExtensionCat import { usePanelCatalog } from "@lichtblick/suite-base/context/PanelCatalogContext"; import { MosaicDropResult, PanelConfig } from "@lichtblick/suite-base/types/panels"; import { getPanelIdForType, getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import { CircularProgress } from "@mui/material"; -import React, { PropsWithChildren, Suspense, useCallback, useMemo } from "react"; -import { useDrop } from "react-dnd"; -import { - MosaicDragType, - MosaicNode, - MosaicPath, - MosaicWindow, - MosaicWithoutDragDropContext, -} from "react-mosaic-component"; -import { makeStyles } from "tss-react/mui"; import ErrorBoundary from "./ErrorBoundary"; import { MosaicPathContext } from "./MosaicPathContext"; diff --git a/packages/suite-base/src/components/PanelOverlay.stories.tsx b/packages/suite-base/src/components/PanelOverlay.stories.tsx index de5f65d4bd..fc647d9881 100644 --- a/packages/suite-base/src/components/PanelOverlay.stories.tsx +++ b/packages/suite-base/src/components/PanelOverlay.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -8,9 +11,10 @@ import { TabDesktopMultiple20Regular, TableSimple20Regular, } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; import { Meta, StoryFn, StoryObj } from "@storybook/react"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { PanelOverlay } from "./PanelOverlay"; export default { diff --git a/packages/suite-base/src/components/PanelOverlay.tsx b/packages/suite-base/src/components/PanelOverlay.tsx index 372ad847fc..4ed6f4ea6e 100644 --- a/packages/suite-base/src/components/PanelOverlay.tsx +++ b/packages/suite-base/src/components/PanelOverlay.tsx @@ -1,9 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; -import { PANEL_TOOLBAR_MIN_HEIGHT } from "@lichtblick/suite-base/components/PanelToolbar"; import { Backdrop, Button, @@ -19,6 +20,9 @@ import { ReactElement } from "react-markdown/lib/react-markdown"; import tc from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; +import { PANEL_TOOLBAR_MIN_HEIGHT } from "@lichtblick/suite-base/components/PanelToolbar"; + const useStyles = makeStyles()((theme, _params, classes) => { const transparentBackground = tc(theme.palette.background.default).setAlpha(0).toRgbString(); const hoverBackground = tc(theme.palette.background.default) diff --git a/packages/suite-base/src/components/PanelRemounter.tsx b/packages/suite-base/src/components/PanelRemounter.tsx index 2331d5ee61..eff091c11f 100644 --- a/packages/suite-base/src/components/PanelRemounter.tsx +++ b/packages/suite-base/src/components/PanelRemounter.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Fragment, ReactNode, useCallback } from "react"; + import { PanelStateStore, usePanelStateStore, } from "@lichtblick/suite-base/context/PanelStateContext"; -import { Fragment, ReactNode, useCallback } from "react"; /** * Wrapper component used to force-remount the panel when key properties like the tabId diff --git a/packages/suite-base/src/components/PanelRoot.tsx b/packages/suite-base/src/components/PanelRoot.tsx index e653a4a0a5..0f3f2b99f1 100644 --- a/packages/suite-base/src/components/PanelRoot.tsx +++ b/packages/suite-base/src/components/PanelRoot.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/components/AppBar/constants"; import { alpha } from "@mui/material"; import { forwardRef, HTMLAttributes, PropsWithChildren } from "react"; import { TransitionStatus } from "react-transition-group"; import { makeStyles } from "tss-react/mui"; +import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/components/AppBar/constants"; + export const PANEL_ROOT_CLASS_NAME = "FoxglovePanelRoot-root"; type PanelRootProps = { diff --git a/packages/suite-base/src/components/PanelSettings/ActionMenu.tsx b/packages/suite-base/src/components/PanelSettings/ActionMenu.tsx index 07c560ee52..711e4e94b4 100644 --- a/packages/suite-base/src/components/PanelSettings/ActionMenu.tsx +++ b/packages/suite-base/src/components/PanelSettings/ActionMenu.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelSettings/index.stories.tsx b/packages/suite-base/src/components/PanelSettings/index.stories.tsx index 3f22da7c2b..d6e25562f2 100644 --- a/packages/suite-base/src/components/PanelSettings/index.stories.tsx +++ b/packages/suite-base/src/components/PanelSettings/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,13 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryFn, StoryObj } from "@storybook/react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; + import { SettingsTreeNodes } from "@lichtblick/suite"; import { PanelCatalog, PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryFn, StoryObj } from "@storybook/react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; import PanelSettings from "."; diff --git a/packages/suite-base/src/components/PanelSettings/index.tsx b/packages/suite-base/src/components/PanelSettings/index.tsx index 28912ea512..a1be6d2a88 100644 --- a/packages/suite-base/src/components/PanelSettings/index.tsx +++ b/packages/suite-base/src/components/PanelSettings/index.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Divider, Typography } from "@mui/material"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { useUnmount } from "react-use"; + import { SettingsTree } from "@lichtblick/suite"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { useConfigById } from "@lichtblick/suite-base/PanelAPI"; @@ -26,10 +34,6 @@ import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; import { PanelConfig } from "@lichtblick/suite-base/types/panels"; import { TAB_PANEL_TYPE } from "@lichtblick/suite-base/util/globalConstants"; import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import { Divider, Typography } from "@mui/material"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { useUnmount } from "react-use"; const singlePanelIdSelector = (state: LayoutState) => typeof state.selectedLayout?.data?.layout === "string" diff --git a/packages/suite-base/src/components/PanelToolbar/ChangePanelMenu.tsx b/packages/suite-base/src/components/PanelToolbar/ChangePanelMenu.tsx index 7f362c3323..2693f6914b 100644 --- a/packages/suite-base/src/components/PanelToolbar/ChangePanelMenu.tsx +++ b/packages/suite-base/src/components/PanelToolbar/ChangePanelMenu.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PanelCatalog, PanelSelection } from "@lichtblick/suite-base/components/PanelCatalog"; -import PanelContext from "@lichtblick/suite-base/components/PanelContext"; -import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { ClickAwayListener, Grow, Paper, Popper } from "@mui/material"; import { useCallback, useContext } from "react"; import { MosaicContext, MosaicNode, MosaicWindowContext } from "react-mosaic-component"; import { makeStyles } from "tss-react/mui"; +import { PanelCatalog, PanelSelection } from "@lichtblick/suite-base/components/PanelCatalog"; +import PanelContext from "@lichtblick/suite-base/components/PanelContext"; +import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; + const useStyles = makeStyles()((theme) => ({ paper: { backgroundColor: theme.palette.background.menu, diff --git a/packages/suite-base/src/components/PanelToolbar/PanelActionsDropdown.tsx b/packages/suite-base/src/components/PanelToolbar/PanelActionsDropdown.tsx index 57e77e9c00..70f5be1d7a 100644 --- a/packages/suite-base/src/components/PanelToolbar/PanelActionsDropdown.tsx +++ b/packages/suite-base/src/components/PanelToolbar/PanelActionsDropdown.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import PanelContext from "@lichtblick/suite-base/components/PanelContext"; -import ChangePanelMenu from "@lichtblick/suite-base/components/PanelToolbar/ChangePanelMenu"; -import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; -import { getPanelTypeFromMosaic } from "@lichtblick/suite-base/components/PanelToolbar/utils"; -import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import { Divider, Menu, MenuItem } from "@mui/material"; @@ -24,6 +22,12 @@ import { useTranslation } from "react-i18next"; import { MosaicContext, MosaicNode, MosaicWindowContext } from "react-mosaic-component"; import { makeStyles } from "tss-react/mui"; +import PanelContext from "@lichtblick/suite-base/components/PanelContext"; +import ChangePanelMenu from "@lichtblick/suite-base/components/PanelToolbar/ChangePanelMenu"; +import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; +import { getPanelTypeFromMosaic } from "@lichtblick/suite-base/components/PanelToolbar/utils"; +import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; + type Props = { isUnknownPanel: boolean; }; diff --git a/packages/suite-base/src/components/PanelToolbar/PanelToolbarControls.tsx b/packages/suite-base/src/components/PanelToolbar/PanelToolbarControls.tsx index a6f80747ce..f45ff9d8be 100644 --- a/packages/suite-base/src/components/PanelToolbar/PanelToolbarControls.tsx +++ b/packages/suite-base/src/components/PanelToolbar/PanelToolbarControls.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import SettingsIcon from "@mui/icons-material/Settings"; +import { forwardRef, useCallback, useContext, useMemo } from "react"; + import PanelContext from "@lichtblick/suite-base/components/PanelContext"; import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; import Stack from "@lichtblick/suite-base/components/Stack"; @@ -21,8 +27,6 @@ import { usePanelStateStore, } from "@lichtblick/suite-base/context/PanelStateContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; -import SettingsIcon from "@mui/icons-material/Settings"; -import { forwardRef, useCallback, useContext, useMemo } from "react"; import { PanelActionsDropdown } from "./PanelActionsDropdown"; diff --git a/packages/suite-base/src/components/PanelToolbar/ToolbarIconButton.tsx b/packages/suite-base/src/components/PanelToolbar/ToolbarIconButton.tsx index 8692cda6e0..abcee10cc0 100644 --- a/packages/suite-base/src/components/PanelToolbar/ToolbarIconButton.tsx +++ b/packages/suite-base/src/components/PanelToolbar/ToolbarIconButton.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PanelToolbar/index.stories.tsx b/packages/suite-base/src/components/PanelToolbar/index.stories.tsx index baf07c7bcf..02529e4eea 100644 --- a/packages/suite-base/src/components/PanelToolbar/index.stories.tsx +++ b/packages/suite-base/src/components/PanelToolbar/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,17 +15,18 @@ // You may not use this file except in compliance with the License. import { Database20Filled } from "@fluentui/react-icons"; -import MockPanelContextProvider from "@lichtblick/suite-base/components/MockPanelContextProvider"; -import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; -import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; -import { PanelStateContextProvider } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import { useTheme } from "@mui/material"; import { StoryObj, StoryFn } from "@storybook/react"; import { fireEvent, screen } from "@storybook/testing-library"; import { PropsWithChildren } from "react"; import { Mosaic, MosaicWindow } from "react-mosaic-component"; +import MockPanelContextProvider from "@lichtblick/suite-base/components/MockPanelContextProvider"; +import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; +import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; +import { PanelStateContextProvider } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; + import PanelToolbar from "./index"; import "react-mosaic-component/react-mosaic-component.css"; diff --git a/packages/suite-base/src/components/PanelToolbar/index.tsx b/packages/suite-base/src/components/PanelToolbar/index.tsx index 848cfad4f5..bc4ff78f6f 100644 --- a/packages/suite-base/src/components/PanelToolbar/index.tsx +++ b/packages/suite-base/src/components/PanelToolbar/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,15 +14,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import PanelContext from "@lichtblick/suite-base/components/PanelContext"; -import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; -import { useDefaultPanelTitle } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { PANEL_TITLE_CONFIG_KEY } from "@lichtblick/suite-base/util/layout"; import FullscreenExitIcon from "@mui/icons-material/FullscreenExit"; import { Typography } from "@mui/material"; import { useContext, useMemo, CSSProperties } from "react"; import { makeStyles } from "tss-react/mui"; +import PanelContext from "@lichtblick/suite-base/components/PanelContext"; +import ToolbarIconButton from "@lichtblick/suite-base/components/PanelToolbar/ToolbarIconButton"; +import { useDefaultPanelTitle } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { PANEL_TITLE_CONFIG_KEY } from "@lichtblick/suite-base/util/layout"; + import { PanelToolbarControls } from "./PanelToolbarControls"; export const PANEL_TOOLBAR_MIN_HEIGHT = 30; diff --git a/packages/suite-base/src/components/PanelToolbar/utils.ts b/packages/suite-base/src/components/PanelToolbar/utils.ts index eed5e74870..d994564e25 100644 --- a/packages/suite-base/src/components/PanelToolbar/utils.ts +++ b/packages/suite-base/src/components/PanelToolbar/utils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; import { getNodeAtPath, MosaicRootActions, MosaicWindowActions } from "react-mosaic-component"; import { MosaicKey } from "react-mosaic-component/lib/types"; +import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; + export function getPanelTypeFromMosaic( mosaicWindowActions?: MosaicWindowActions, mosaicActions?: MosaicRootActions, diff --git a/packages/suite-base/src/components/PlaybackControls/EventsOverlay.tsx b/packages/suite-base/src/components/PlaybackControls/EventsOverlay.tsx index 6060e40e34..62a64baa9a 100644 --- a/packages/suite-base/src/components/PlaybackControls/EventsOverlay.tsx +++ b/packages/suite-base/src/components/PlaybackControls/EventsOverlay.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { alpha } from "@mui/material"; +import * as _ from "lodash-es"; +import { makeStyles } from "tss-react/mui"; + import { EventsStore, TimelinePositionedEvent, @@ -11,9 +18,6 @@ import { TimelineInteractionStateStore, useTimelineInteractionState, } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; -import { alpha } from "@mui/material"; -import * as _ from "lodash-es"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()(({ transitions, palette }) => ({ root: { diff --git a/packages/suite-base/src/components/PlaybackControls/PlaybackBarHoverTicks.tsx b/packages/suite-base/src/components/PlaybackControls/PlaybackBarHoverTicks.tsx index 9112f37fd9..0b0e96a781 100644 --- a/packages/suite-base/src/components/PlaybackControls/PlaybackBarHoverTicks.tsx +++ b/packages/suite-base/src/components/PlaybackControls/PlaybackBarHoverTicks.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { add, fromSec, toSec } from "@foxglove/rostime"; +import { Tooltip } from "@mui/material"; +import { useMemo } from "react"; +import { useResizeDetector } from "react-resize-detector"; +import { makeStyles } from "tss-react/mui"; + import { RpcScales } from "@lichtblick/suite-base/components/Chart/types"; import { MessagePipelineContext, @@ -11,12 +20,6 @@ import Stack from "@lichtblick/suite-base/components/Stack"; import HoverBar from "@lichtblick/suite-base/components/TimeBasedChart/HoverBar"; import { useHoverValue } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import { Tooltip } from "@mui/material"; -import { useMemo } from "react"; -import { useResizeDetector } from "react-resize-detector"; -import { makeStyles } from "tss-react/mui"; - -import { add, fromSec, toSec } from "@foxglove/rostime"; const useStyles = makeStyles()((theme) => ({ tick: { diff --git a/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.stories.tsx b/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.stories.tsx index 46d8dd80fe..47b1f7c440 100644 --- a/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.stories.tsx +++ b/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useTheme } from "@mui/material"; +import { StoryObj, StoryFn } from "@storybook/react"; +import { useEffect } from "react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { PlaybackControlsTooltipContent } from "@lichtblick/suite-base/components/PlaybackControls/PlaybackControlsTooltipContent"; import { useTimelineInteractionState } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import TimelineInteractionStateProvider from "@lichtblick/suite-base/providers/TimelineInteractionStateProvider"; -import { useTheme } from "@mui/material"; -import { StoryObj, StoryFn } from "@storybook/react"; -import { useEffect } from "react"; function Wrapper(Wrapped: StoryFn): JSX.Element { const theme = useTheme(); diff --git a/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.tsx b/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.tsx index 136fb98d96..94299d79b0 100644 --- a/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.tsx +++ b/packages/suite-base/src/components/PlaybackControls/PlaybackControlsTooltipContent.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { subtract as subtractTimes, toSec, Time } from "@foxglove/rostime"; +import { Divider, Typography } from "@mui/material"; +import * as _ from "lodash-es"; +import { Fragment } from "react"; +import { makeStyles } from "tss-react/mui"; + import { MessagePipelineContext, useMessagePipeline, @@ -11,12 +20,6 @@ import { useTimelineInteractionState, } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import { Divider, Typography } from "@mui/material"; -import * as _ from "lodash-es"; -import { Fragment } from "react"; -import { makeStyles } from "tss-react/mui"; - -import { subtract as subtractTimes, toSec, Time } from "@foxglove/rostime"; type PlaybackControlsTooltipItem = | { type: "divider" } diff --git a/packages/suite-base/src/components/PlaybackControls/PlaybackTimeDisplay.tsx b/packages/suite-base/src/components/PlaybackControls/PlaybackTimeDisplay.tsx index fef439e6d0..4ef8def314 100644 --- a/packages/suite-base/src/components/PlaybackControls/PlaybackTimeDisplay.tsx +++ b/packages/suite-base/src/components/PlaybackControls/PlaybackTimeDisplay.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Time } from "@foxglove/rostime"; + import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { MessagePipelineContext, @@ -19,8 +24,6 @@ import { import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; -import { Time } from "@foxglove/rostime"; - import { UnconnectedPlaybackTimeDisplay } from "./UnconnectedPlaybackTimeDisplay"; type Props = { diff --git a/packages/suite-base/src/components/PlaybackControls/ProgressPlot.stories.tsx b/packages/suite-base/src/components/PlaybackControls/ProgressPlot.stories.tsx index 452e03e3ce..e056b1c6c8 100644 --- a/packages/suite-base/src/components/PlaybackControls/ProgressPlot.stories.tsx +++ b/packages/suite-base/src/components/PlaybackControls/ProgressPlot.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PlaybackControls/ProgressPlot.tsx b/packages/suite-base/src/components/PlaybackControls/ProgressPlot.tsx index 34ccc7465c..7b0aa5704f 100644 --- a/packages/suite-base/src/components/PlaybackControls/ProgressPlot.tsx +++ b/packages/suite-base/src/components/PlaybackControls/ProgressPlot.tsx @@ -1,18 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { keyframes } from "@emotion/react"; -import { filterMap } from "@lichtblick/den/collection"; -import { Immutable } from "@lichtblick/suite"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { Range } from "@lichtblick/suite-base/util/ranges"; import { simplify } from "intervals-fn"; import * as _ from "lodash-es"; import { useMemo } from "react"; import tinycolor from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import { filterMap } from "@lichtblick/den/collection"; +import { Immutable } from "@lichtblick/suite"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { Range } from "@lichtblick/suite-base/util/ranges"; + type ProgressProps = Immutable<{ loading: boolean; availableRanges?: Range[]; diff --git a/packages/suite-base/src/components/PlaybackControls/RepeatAdapter.tsx b/packages/suite-base/src/components/PlaybackControls/RepeatAdapter.tsx index 321c5ac392..325b1bfba6 100644 --- a/packages/suite-base/src/components/PlaybackControls/RepeatAdapter.tsx +++ b/packages/suite-base/src/components/PlaybackControls/RepeatAdapter.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { compare, Time } from "@foxglove/rostime"; +import { useLayoutEffect } from "react"; + import { MessagePipelineContext, useMessagePipeline, } from "@lichtblick/suite-base/components/MessagePipeline"; -import { useLayoutEffect } from "react"; - -import { compare, Time } from "@foxglove/rostime"; type RepeatAdapterProps = { repeatEnabled: boolean; diff --git a/packages/suite-base/src/components/PlaybackControls/Scrubber.tsx b/packages/suite-base/src/components/PlaybackControls/Scrubber.tsx index 5995a0c116..782f2fe5ea 100644 --- a/packages/suite-base/src/components/PlaybackControls/Scrubber.tsx +++ b/packages/suite-base/src/components/PlaybackControls/Scrubber.tsx @@ -1,7 +1,24 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { + subtract as subtractTimes, + add as addTimes, + toSec, + fromSec, + Time, +} from "@foxglove/rostime"; +import { Fade, PopperProps, Tooltip } from "@mui/material"; +import type { Instance } from "@popperjs/core"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useLatest } from "react-use"; +import { makeStyles } from "tss-react/mui"; +import { v4 as uuidv4 } from "uuid"; + import { MessagePipelineContext, useMessagePipeline, @@ -12,20 +29,6 @@ import { useSetHoverValue, } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import { PlayerPresence } from "@lichtblick/suite-base/players/types"; -import { Fade, PopperProps, Tooltip } from "@mui/material"; -import type { Instance } from "@popperjs/core"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import { useLatest } from "react-use"; -import { makeStyles } from "tss-react/mui"; -import { v4 as uuidv4 } from "uuid"; - -import { - subtract as subtractTimes, - add as addTimes, - toSec, - fromSec, - Time, -} from "@foxglove/rostime"; import { EventsOverlay } from "./EventsOverlay"; import PlaybackBarHoverTicks from "./PlaybackBarHoverTicks"; diff --git a/packages/suite-base/src/components/PlaybackControls/Slider.stories.tsx b/packages/suite-base/src/components/PlaybackControls/Slider.stories.tsx index a233512369..d6851514f1 100644 --- a/packages/suite-base/src/components/PlaybackControls/Slider.stories.tsx +++ b/packages/suite-base/src/components/PlaybackControls/Slider.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Stack from "@lichtblick/suite-base/components/Stack"; import { StoryObj } from "@storybook/react"; import { useState } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import Slider from "./Slider"; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/components/PlaybackControls/Slider.tsx b/packages/suite-base/src/components/PlaybackControls/Slider.tsx index f76624f1c8..32e5039dc6 100644 --- a/packages/suite-base/src/components/PlaybackControls/Slider.tsx +++ b/packages/suite-base/src/components/PlaybackControls/Slider.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { scaleValue } from "@lichtblick/den/math"; import * as _ from "lodash-es"; import { useCallback, useEffect, useRef, ReactNode, useState, useLayoutEffect } from "react"; import { makeStyles } from "tss-react/mui"; +import { scaleValue } from "@lichtblick/den/math"; + export type HoverOverEvent = { /** Hovered `fraction` value */ fraction: number; diff --git a/packages/suite-base/src/components/PlaybackControls/UnconnectedPlaybackTimeDisplay.tsx b/packages/suite-base/src/components/PlaybackControls/UnconnectedPlaybackTimeDisplay.tsx index 2b7d4d8f6d..3ec9f9e9b7 100644 --- a/packages/suite-base/src/components/PlaybackControls/UnconnectedPlaybackTimeDisplay.tsx +++ b/packages/suite-base/src/components/PlaybackControls/UnconnectedPlaybackTimeDisplay.tsx @@ -1,16 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { IAppTimeFormat } from "@lichtblick/suite-base/hooks/useAppTimeFormat"; -import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; -import { - formatDate, - formatTime, - getValidatedTimeAndMethodFromString, -} from "@lichtblick/suite-base/util/formatTime"; -import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; +import { Time, isTimeInRangeInclusive } from "@foxglove/rostime"; import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; import CheckIcon from "@mui/icons-material/Check"; import WarningIcon from "@mui/icons-material/Warning"; @@ -28,7 +23,15 @@ import { import { useState, useCallback, useMemo, useEffect, MouseEvent, useRef } from "react"; import { makeStyles } from "tss-react/mui"; -import { Time, isTimeInRangeInclusive } from "@foxglove/rostime"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { IAppTimeFormat } from "@lichtblick/suite-base/hooks/useAppTimeFormat"; +import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; +import { + formatDate, + formatTime, + getValidatedTimeAndMethodFromString, +} from "@lichtblick/suite-base/util/formatTime"; +import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; type PlaybackTimeDisplayMethodProps = { appTimeFormat: IAppTimeFormat; diff --git a/packages/suite-base/src/components/PlaybackControls/index.stories.tsx b/packages/suite-base/src/components/PlaybackControls/index.stories.tsx index 49d557c4a2..d2c1046a0b 100644 --- a/packages/suite-base/src/components/PlaybackControls/index.stories.tsx +++ b/packages/suite-base/src/components/PlaybackControls/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { action } from "@storybook/addon-actions"; +import { StoryObj, StoryFn } from "@storybook/react"; +import { useEffect, useLayoutEffect } from "react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import AppConfigurationContext, { IAppConfiguration, @@ -27,9 +34,6 @@ import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentL import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; import { makeMockEvents } from "@lichtblick/suite-base/test/mocks/makeMockEvents"; -import { action } from "@storybook/addon-actions"; -import { StoryObj, StoryFn } from "@storybook/react"; -import { useEffect, useLayoutEffect } from "react"; import PlaybackControls from "./index"; diff --git a/packages/suite-base/src/components/PlaybackControls/index.tsx b/packages/suite-base/src/components/PlaybackControls/index.tsx index 5ed9d9edf0..0baf847135 100644 --- a/packages/suite-base/src/components/PlaybackControls/index.tsx +++ b/packages/suite-base/src/components/PlaybackControls/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -24,6 +27,11 @@ import { Previous20Filled, Previous20Regular, } from "@fluentui/react-icons"; +import { Time, compare } from "@foxglove/rostime"; +import { Tooltip } from "@mui/material"; +import { useCallback, useMemo, useState } from "react"; +import { makeStyles } from "tss-react/mui"; + import { CreateEventDialog } from "@lichtblick/suite-base/components/CreateEventDialog"; import { DataSourceInfoView } from "@lichtblick/suite-base/components/DataSourceInfoView"; import EventIcon from "@lichtblick/suite-base/components/EventIcon"; @@ -44,11 +52,6 @@ import { } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; import { Player, PlayerPresence } from "@lichtblick/suite-base/players/types"; -import { Tooltip } from "@mui/material"; -import { useCallback, useMemo, useState } from "react"; -import { makeStyles } from "tss-react/mui"; - -import { Time, compare } from "@foxglove/rostime"; import PlaybackTimeDisplay from "./PlaybackTimeDisplay"; import { RepeatAdapter } from "./RepeatAdapter"; diff --git a/packages/suite-base/src/components/PlaybackControls/sharedHelpers.ts b/packages/suite-base/src/components/PlaybackControls/sharedHelpers.ts index 95a645d029..765ea7f471 100644 --- a/packages/suite-base/src/components/PlaybackControls/sharedHelpers.ts +++ b/packages/suite-base/src/components/PlaybackControls/sharedHelpers.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PlaybackSpeedControls.stories.tsx b/packages/suite-base/src/components/PlaybackSpeedControls.stories.tsx index d6bf8b1f98..ac28710924 100644 --- a/packages/suite-base/src/components/PlaybackSpeedControls.stories.tsx +++ b/packages/suite-base/src/components/PlaybackSpeedControls.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Meta, StoryObj } from "@storybook/react"; +import { screen, userEvent } from "@storybook/testing-library"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import PlaybackSpeedControls from "@lichtblick/suite-base/components/PlaybackSpeedControls"; import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; -import { Meta, StoryObj } from "@storybook/react"; -import { screen, userEvent } from "@storybook/testing-library"; const CAPABILITIES = ["setSpeed", "playbackControl"]; diff --git a/packages/suite-base/src/components/PlaybackSpeedControls.tsx b/packages/suite-base/src/components/PlaybackSpeedControls.tsx index 159ec6bd3e..ac9973582e 100644 --- a/packages/suite-base/src/components/PlaybackSpeedControls.tsx +++ b/packages/suite-base/src/components/PlaybackSpeedControls.tsx @@ -1,18 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; +import CheckIcon from "@mui/icons-material/Check"; +import { Button, ListItemIcon, ListItemText, Menu, MenuItem } from "@mui/material"; +import { useCallback, useEffect, useState } from "react"; +import { makeStyles } from "tss-react/mui"; + import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; import { LayoutState, useCurrentLayoutActions, useCurrentLayoutSelector, } from "@lichtblick/suite-base/context/CurrentLayoutContext"; -import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; -import CheckIcon from "@mui/icons-material/Check"; -import { Button, ListItemIcon, ListItemText, Menu, MenuItem } from "@mui/material"; -import { useCallback, useEffect, useState } from "react"; -import { makeStyles } from "tss-react/mui"; const SPEED_OPTIONS = [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 0.8, 1, 2, 3, 5]; diff --git a/packages/suite-base/src/components/PlayerManager.tsx b/packages/suite-base/src/components/PlayerManager.tsx index 47da0a016b..80334e96e8 100644 --- a/packages/suite-base/src/components/PlayerManager.tsx +++ b/packages/suite-base/src/components/PlayerManager.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,18 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useSnackbar } from "notistack"; +import { + PropsWithChildren, + useCallback, + useContext, + useEffect, + useLayoutEffect, + useMemo, + useState, +} from "react"; +import { useLatest, useMountedState } from "react-use"; + import { useWarnImmediateReRender } from "@lichtblick/hooks"; import Logger from "@lichtblick/log"; import { Immutable } from "@lichtblick/suite"; @@ -43,17 +58,6 @@ import { import UserScriptPlayer from "@lichtblick/suite-base/players/UserScriptPlayer"; import { Player } from "@lichtblick/suite-base/players/types"; import { UserScripts } from "@lichtblick/suite-base/types/panels"; -import { useSnackbar } from "notistack"; -import { - PropsWithChildren, - useCallback, - useContext, - useEffect, - useLayoutEffect, - useMemo, - useState, -} from "react"; -import { useLatest, useMountedState } from "react-use"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/components/ProblemsList.stories.tsx b/packages/suite-base/src/components/ProblemsList.stories.tsx index b7f070acb7..8293aa3644 100644 --- a/packages/suite-base/src/components/ProblemsList.stories.tsx +++ b/packages/suite-base/src/components/ProblemsList.stories.tsx @@ -1,18 +1,21 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromDate } from "@foxglove/rostime"; +import { useTheme } from "@mui/material"; +import { StoryFn, StoryObj } from "@storybook/react"; +import { useEffect } from "react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { ProblemsList } from "@lichtblick/suite-base/components/ProblemsList"; import { useProblemsActions } from "@lichtblick/suite-base/context/ProblemsContext"; import { PlayerPresence, PlayerProblem, Topic } from "@lichtblick/suite-base/players/types"; import ProblemsContextProvider from "@lichtblick/suite-base/providers/ProblemsContextProvider"; import WorkspaceContextProvider from "@lichtblick/suite-base/providers/WorkspaceContextProvider"; -import { useTheme } from "@mui/material"; -import { StoryFn, StoryObj } from "@storybook/react"; -import { useEffect } from "react"; - -import { fromDate } from "@foxglove/rostime"; function makeProblems(): PlayerProblem[] { return [ diff --git a/packages/suite-base/src/components/ProblemsList.tsx b/packages/suite-base/src/components/ProblemsList.tsx index 7480f9a2a5..1b268de00b 100644 --- a/packages/suite-base/src/components/ProblemsList.tsx +++ b/packages/suite-base/src/components/ProblemsList.tsx @@ -1,20 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ErrorCircle16Regular, Info16Regular, Warning16Regular } from "@fluentui/react-icons"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import { - MessagePipelineContext, - useMessagePipeline, -} from "@lichtblick/suite-base/components/MessagePipeline"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { - ProblemsContextStore, - useProblemsStore, -} from "@lichtblick/suite-base/context/ProblemsContext"; -import { PlayerProblem } from "@lichtblick/suite-base/players/types"; -import { DetailsType, NotificationSeverity } from "@lichtblick/suite-base/util/sendNotification"; import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; import { Accordion, @@ -29,6 +20,19 @@ import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import { + MessagePipelineContext, + useMessagePipeline, +} from "@lichtblick/suite-base/components/MessagePipeline"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { + ProblemsContextStore, + useProblemsStore, +} from "@lichtblick/suite-base/context/ProblemsContext"; +import { PlayerProblem } from "@lichtblick/suite-base/players/types"; +import { DetailsType, NotificationSeverity } from "@lichtblick/suite-base/util/sendNotification"; + const useStyles = makeStyles()((theme) => ({ acccordion: { background: "none", diff --git a/packages/suite-base/src/components/PublishGoalIcon.tsx b/packages/suite-base/src/components/PublishGoalIcon.tsx index 332b83c21b..d993a4e3a3 100644 --- a/packages/suite-base/src/components/PublishGoalIcon.tsx +++ b/packages/suite-base/src/components/PublishGoalIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PublishPointIcon.tsx b/packages/suite-base/src/components/PublishPointIcon.tsx index fbd253e2d4..a4cd916f63 100644 --- a/packages/suite-base/src/components/PublishPointIcon.tsx +++ b/packages/suite-base/src/components/PublishPointIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/PublishPoseEstimateIcon.tsx b/packages/suite-base/src/components/PublishPoseEstimateIcon.tsx index 00beb3b085..68b76dfd48 100644 --- a/packages/suite-base/src/components/PublishPoseEstimateIcon.tsx +++ b/packages/suite-base/src/components/PublishPoseEstimateIcon.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/RemountOnValueChange.test.tsx b/packages/suite-base/src/components/RemountOnValueChange.test.tsx index cf8320bb4c..abd7cb9b3e 100644 --- a/packages/suite-base/src/components/RemountOnValueChange.test.tsx +++ b/packages/suite-base/src/components/RemountOnValueChange.test.tsx @@ -1,12 +1,16 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import RemountOnValueChange from "@lichtblick/suite-base/components/RemountOnValueChange"; import { render } from "@testing-library/react"; import { useLayoutEffect } from "react"; +import RemountOnValueChange from "@lichtblick/suite-base/components/RemountOnValueChange"; + describe("RemountOnValueChange", () => { it("should render once with an initial value", () => { let mountCount = 0; diff --git a/packages/suite-base/src/components/RemountOnValueChange.tsx b/packages/suite-base/src/components/RemountOnValueChange.tsx index b2a3add10f..81b7ec52f2 100644 --- a/packages/suite-base/src/components/RemountOnValueChange.tsx +++ b/packages/suite-base/src/components/RemountOnValueChange.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SendNotificationToastAdapter.stories.tsx b/packages/suite-base/src/components/SendNotificationToastAdapter.stories.tsx index e789544cbb..d388fdd1c8 100644 --- a/packages/suite-base/src/components/SendNotificationToastAdapter.stories.tsx +++ b/packages/suite-base/src/components/SendNotificationToastAdapter.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryFn, StoryObj } from "@storybook/react"; +import { useEffect } from "react"; + import SendNotificationToastAdapter from "@lichtblick/suite-base/components/SendNotificationToastAdapter"; import StudioToastProvider from "@lichtblick/suite-base/components/StudioToastProvider"; import sendNotification from "@lichtblick/suite-base/util/sendNotification"; -import { StoryFn, StoryObj } from "@storybook/react"; -import { useEffect } from "react"; const fakeError = () => { const err = Error("This error is on purpose - it comes from the story"); diff --git a/packages/suite-base/src/components/SendNotificationToastAdapter.tsx b/packages/suite-base/src/components/SendNotificationToastAdapter.tsx index 86692dff8e..a99fb0b949 100644 --- a/packages/suite-base/src/components/SendNotificationToastAdapter.tsx +++ b/packages/suite-base/src/components/SendNotificationToastAdapter.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Link } from "@mui/material"; +import { useSnackbar, VariantType } from "notistack"; +import { useLayoutEffect, useState } from "react"; + import NotificationModal from "@lichtblick/suite-base/components/NotificationModal"; import { DetailsType, @@ -11,9 +18,6 @@ import { NotificationSeverity, NotificationMessage, } from "@lichtblick/suite-base/util/sendNotification"; -import { Link } from "@mui/material"; -import { useSnackbar, VariantType } from "notistack"; -import { useLayoutEffect, useState } from "react"; const severityToToastAppearance = (severity: NotificationSeverity): VariantType => { switch (severity) { diff --git a/packages/suite-base/src/components/SettingsTreeEditor/FieldEditor.tsx b/packages/suite-base/src/components/SettingsTreeEditor/FieldEditor.tsx index bebea314c7..1eb22b5622 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/FieldEditor.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/FieldEditor.tsx @@ -1,11 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable, SettingsTreeAction, SettingsTreeField } from "@lichtblick/suite"; -import MessagePathInput from "@lichtblick/suite-base/components/MessagePathSyntax/MessagePathInput"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; import CancelIcon from "@mui/icons-material/Cancel"; import ErrorIcon from "@mui/icons-material/Error"; import { @@ -23,6 +22,11 @@ import { import { makeStyles } from "tss-react/mui"; import { v4 as uuid } from "uuid"; +import { Immutable, SettingsTreeAction, SettingsTreeField } from "@lichtblick/suite"; +import MessagePathInput from "@lichtblick/suite-base/components/MessagePathSyntax/MessagePathInput"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; + import { ColorGradientInput, ColorPickerInput, NumberInput, Vec2Input, Vec3Input } from "./inputs"; /** Used to allow both undefined and empty string in select inputs. */ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/NodeActionsMenu.tsx b/packages/suite-base/src/components/SettingsTreeEditor/NodeActionsMenu.tsx index 4b4966f744..83a2548119 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/NodeActionsMenu.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/NodeActionsMenu.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeNodeAction } from "@lichtblick/suite"; import MoreVertIcon from "@mui/icons-material/MoreVert"; import { Menu, MenuItem, IconButton, ListItemIcon, ListItemText, Divider } from "@mui/material"; import { useState } from "react"; +import { SettingsTreeNodeAction } from "@lichtblick/suite"; + import { icons } from "./icons"; export function NodeActionsMenu({ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/NodeEditor.tsx b/packages/suite-base/src/components/SettingsTreeEditor/NodeEditor.tsx index 70ac5feb57..372e73ba45 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/NodeEditor.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/NodeEditor.tsx @@ -1,17 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { filterMap } from "@lichtblick/den/collection"; -import { - Immutable, - SettingsTreeAction, - SettingsTreeNode, - SettingsTreeNodeActionItem, -} from "@lichtblick/suite"; -import { HighlightedText } from "@lichtblick/suite-base/components/HighlightedText"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; import ArrowDownIcon from "@mui/icons-material/ArrowDropDown"; import ArrowRightIcon from "@mui/icons-material/ArrowRight"; import CheckIcon from "@mui/icons-material/Check"; @@ -28,6 +21,17 @@ import { keyframes } from "tss-react"; import { makeStyles } from "tss-react/mui"; import { useImmer } from "use-immer"; +import { filterMap } from "@lichtblick/den/collection"; +import { + Immutable, + SettingsTreeAction, + SettingsTreeNode, + SettingsTreeNodeActionItem, +} from "@lichtblick/suite"; +import { HighlightedText } from "@lichtblick/suite-base/components/HighlightedText"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; + import { FieldEditor } from "./FieldEditor"; import { NodeActionsMenu } from "./NodeActionsMenu"; import { VisibilityToggle } from "./VisibilityToggle"; diff --git a/packages/suite-base/src/components/SettingsTreeEditor/VisibilityToggle.tsx b/packages/suite-base/src/components/SettingsTreeEditor/VisibilityToggle.tsx index b2a91f8aba..89be193445 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/VisibilityToggle.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/VisibilityToggle.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/icons.ts b/packages/suite-base/src/components/SettingsTreeEditor/icons.ts index efcb0244a1..3eca65247d 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/icons.ts +++ b/packages/suite-base/src/components/SettingsTreeEditor/icons.ts @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsIcon } from "@lichtblick/suite"; import Clock from "@mui/icons-material/AccessTime"; import Add from "@mui/icons-material/Add"; import Addchart from "@mui/icons-material/Addchart"; @@ -43,6 +45,8 @@ import Cells from "@mui/icons-material/ViewComfy"; import Cube from "@mui/icons-material/ViewInAr"; import ImageProjection from "@mui/icons-material/Vrpano"; +import { SettingsIcon } from "@lichtblick/suite"; + const icons: Record = { Add, Addchart, diff --git a/packages/suite-base/src/components/SettingsTreeEditor/index.stories.tsx b/packages/suite-base/src/components/SettingsTreeEditor/index.stories.tsx index 6c5c099237..3f67d47639 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/index.stories.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/index.stories.tsx @@ -1,7 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useTheme } from "@mui/material"; +import { StoryObj } from "@storybook/react"; +import { userEvent, within } from "@storybook/testing-library"; +import { produce } from "immer"; +import * as _ from "lodash-es"; +import { useCallback, useMemo, useState, useEffect } from "react"; + import Logger from "@lichtblick/log"; import { SettingsTreeNode, @@ -13,12 +23,6 @@ import { MessagePathInputStoryFixture } from "@lichtblick/suite-base/components/ import SettingsTreeEditor from "@lichtblick/suite-base/components/SettingsTreeEditor"; import Stack from "@lichtblick/suite-base/components/Stack"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { useTheme } from "@mui/material"; -import { StoryObj } from "@storybook/react"; -import { userEvent, within } from "@storybook/testing-library"; -import { produce } from "immer"; -import * as _ from "lodash-es"; -import { useCallback, useMemo, useState, useEffect } from "react"; export default { title: "components/SettingsTreeEditor", diff --git a/packages/suite-base/src/components/SettingsTreeEditor/index.tsx b/packages/suite-base/src/components/SettingsTreeEditor/index.tsx index b9c7457db0..0728151b17 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/index.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/index.tsx @@ -1,7 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import CancelIcon from "@mui/icons-material/Cancel"; +import SearchIcon from "@mui/icons-material/Search"; +import { IconButton, TextField } from "@mui/material"; +import memoizeWeak from "memoize-weak"; +import { useCallback, useMemo, useState } from "react"; +import { useTranslation } from "react-i18next"; +import { makeStyles } from "tss-react/mui"; + import { Immutable, SettingsTree, SettingsTreeAction, SettingsTreeField } from "@lichtblick/suite"; import { useConfigById } from "@lichtblick/suite-base/PanelAPI"; import { FieldEditor } from "@lichtblick/suite-base/components/SettingsTreeEditor/FieldEditor"; @@ -10,13 +21,6 @@ import { useSelectedPanels } from "@lichtblick/suite-base/context/CurrentLayoutC import { usePanelCatalog } from "@lichtblick/suite-base/context/PanelCatalogContext"; import { usePanelStateStore } from "@lichtblick/suite-base/context/PanelStateContext"; import { PANEL_TITLE_CONFIG_KEY, getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import CancelIcon from "@mui/icons-material/Cancel"; -import SearchIcon from "@mui/icons-material/Search"; -import { IconButton, TextField } from "@mui/material"; -import memoizeWeak from "memoize-weak"; -import { useCallback, useMemo, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { makeStyles } from "tss-react/mui"; import { NodeEditor } from "./NodeEditor"; import { filterTreeNodes, prepareSettingsNodes } from "./utils"; diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.stories.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.stories.tsx index a37e54bfc2..560fec73ab 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.stories.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.tsx index fb7a795940..eb0eb52c70 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorGradientInput.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { Popover, TextField, useTheme } from "@mui/material"; import { useCallback, useState } from "react"; import tinycolor from "tinycolor2"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { ColorPickerControl, useColorPickerControl } from "./ColorPickerControl"; import { ColorSwatch } from "./ColorSwatch"; diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.stories.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.stories.tsx index d50f5505b5..251e453df4 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.stories.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.test.ts b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.test.ts index 9a392ba49c..8416f1b42f 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.test.ts +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.tsx index 8d650663c7..f0e6007267 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerControl.tsx @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import TagIcon from "@mui/icons-material/Tag"; import { TextField } from "@mui/material"; import { useCallback, useState, useMemo } from "react"; @@ -11,6 +13,8 @@ import tinycolor from "tinycolor2"; import { makeStyles } from "tss-react/mui"; import { useDebouncedCallback } from "use-debounce"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme) => ({ picker: { "&.react-colorful": { diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerInput.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerInput.tsx index 08167564f3..011ab7e533 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerInput.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorPickerInput.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import CancelIcon from "@mui/icons-material/Cancel"; import { TextField, Popover, IconButton, inputBaseClasses, Tooltip } from "@mui/material"; import { useCallback, MouseEvent, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { ColorPickerControl, useColorPickerControl } from "./ColorPickerControl"; import { ColorSwatch } from "./ColorSwatch"; diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorSwatch.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorSwatch.tsx index 6bdf3cdda8..ac4cfbe50d 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorSwatch.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/ColorSwatch.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/NumberInput.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/NumberInput.tsx index 1172d55ad3..d80791f505 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/NumberInput.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/NumberInput.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec2Input.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec2Input.tsx index 1afb7543ef..e368932d4f 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec2Input.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec2Input.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { useCallback } from "react"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { NumberInput } from "./NumberInput"; type Vec2Props = { diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec3Input.tsx b/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec3Input.tsx index 6863a51d37..c6de3219b0 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec3Input.tsx +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/Vec3Input.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { useCallback } from "react"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import { NumberInput } from "./NumberInput"; type Vec3Props = { diff --git a/packages/suite-base/src/components/SettingsTreeEditor/inputs/index.ts b/packages/suite-base/src/components/SettingsTreeEditor/inputs/index.ts index 12e55c2021..7890c50e5c 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/inputs/index.ts +++ b/packages/suite-base/src/components/SettingsTreeEditor/inputs/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/SettingsTreeEditor/utils.ts b/packages/suite-base/src/components/SettingsTreeEditor/utils.ts index 6d9f71b590..2f21f71103 100644 --- a/packages/suite-base/src/components/SettingsTreeEditor/utils.ts +++ b/packages/suite-base/src/components/SettingsTreeEditor/utils.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; import * as _ from "lodash-es"; +import { Immutable, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; + /** * Filters and sorts roots to prepare them for rendering. */ diff --git a/packages/suite-base/src/components/ShareJsonModal.stories.tsx b/packages/suite-base/src/components/ShareJsonModal.stories.tsx index 49d99516b9..745c6dc9fa 100644 --- a/packages/suite-base/src/components/ShareJsonModal.stories.tsx +++ b/packages/suite-base/src/components/ShareJsonModal.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { fireEvent, screen } from "@storybook/testing-library"; + import { ShareJsonModal, ShareJsonModalProps, } from "@lichtblick/suite-base/components/ShareJsonModal"; -import { StoryObj } from "@storybook/react"; -import { fireEvent, screen } from "@storybook/testing-library"; export default { title: "components/ShareJsonModal", diff --git a/packages/suite-base/src/components/ShareJsonModal.tsx b/packages/suite-base/src/components/ShareJsonModal.tsx index 70991f2fce..ebe46b71a2 100644 --- a/packages/suite-base/src/components/ShareJsonModal.tsx +++ b/packages/suite-base/src/components/ShareJsonModal.tsx @@ -1,12 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ArrowDownload20Filled, Delete20Regular } from "@fluentui/react-icons"; -import CopyButton from "@lichtblick/suite-base/components/CopyButton"; -import HoverableIconButton from "@lichtblick/suite-base/components/HoverableIconButton"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { downloadTextFile } from "@lichtblick/suite-base/util/download"; import CloseIcon from "@mui/icons-material/Close"; import { Button, @@ -21,6 +20,11 @@ import { import { useCallback, useMemo, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import CopyButton from "@lichtblick/suite-base/components/CopyButton"; +import HoverableIconButton from "@lichtblick/suite-base/components/HoverableIconButton"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { downloadTextFile } from "@lichtblick/suite-base/util/download"; + export type ShareJsonModalProps = { onRequestClose: () => void; onChange: (value: unknown) => void; diff --git a/packages/suite-base/src/components/SidebarContent.tsx b/packages/suite-base/src/components/SidebarContent.tsx index 755ef51678..fecf8915da 100644 --- a/packages/suite-base/src/components/SidebarContent.tsx +++ b/packages/suite-base/src/components/SidebarContent.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { Typography } from "@mui/material"; import { CSSProperties, Fragment, PropsWithChildren } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme) => ({ leadingItems: { display: "flex", diff --git a/packages/suite-base/src/components/Sidebars/NewSidebar.stories.tsx b/packages/suite-base/src/components/Sidebars/NewSidebar.stories.tsx index 3a1b261167..efed71cec3 100644 --- a/packages/suite-base/src/components/Sidebars/NewSidebar.stories.tsx +++ b/packages/suite-base/src/components/Sidebars/NewSidebar.stories.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; import { StoryObj } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; import { PropsWithChildren, useEffect, useState } from "react"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; + import Sidebars, { SidebarItem } from "."; import { NewSidebarItem } from "./NewSidebar"; diff --git a/packages/suite-base/src/components/Sidebars/NewSidebar.tsx b/packages/suite-base/src/components/Sidebars/NewSidebar.tsx index d760018625..381212829d 100644 --- a/packages/suite-base/src/components/Sidebars/NewSidebar.tsx +++ b/packages/suite-base/src/components/Sidebars/NewSidebar.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import CloseIcon from "@mui/icons-material/Close"; import { Badge, BadgeProps, Divider, IconButton, Tab, Tabs } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme) => ({ root: { boxSizing: "content-box", diff --git a/packages/suite-base/src/components/Sidebars/TabSpacer.tsx b/packages/suite-base/src/components/Sidebars/TabSpacer.tsx index 260802a398..cfa547aaa6 100644 --- a/packages/suite-base/src/components/Sidebars/TabSpacer.tsx +++ b/packages/suite-base/src/components/Sidebars/TabSpacer.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Sidebars/index.stories.tsx b/packages/suite-base/src/components/Sidebars/index.stories.tsx index 8bba9354a7..ed30849dd4 100644 --- a/packages/suite-base/src/components/Sidebars/index.stories.tsx +++ b/packages/suite-base/src/components/Sidebars/index.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; import { StoryObj } from "@storybook/react"; import { useEffect, useState } from "react"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; + import Sidebars, { SidebarItem } from "."; export default { diff --git a/packages/suite-base/src/components/Sidebars/index.tsx b/packages/suite-base/src/components/Sidebars/index.tsx index 22b1b85021..95ab54cdaf 100644 --- a/packages/suite-base/src/components/Sidebars/index.tsx +++ b/packages/suite-base/src/components/Sidebars/index.tsx @@ -1,15 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import { HelpMenu } from "@lichtblick/suite-base/components/AppBar/HelpMenu"; -import { BuiltinIcon } from "@lichtblick/suite-base/components/BuiltinIcon"; -import ErrorBoundary from "@lichtblick/suite-base/components/ErrorBoundary"; -import { MemoryUseIndicator } from "@lichtblick/suite-base/components/MemoryUseIndicator"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; -import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; import HelpOutlineIcon from "@mui/icons-material/HelpOutline"; import { Badge, Paper, Tab, Tabs } from "@mui/material"; import { @@ -24,6 +19,15 @@ import { import { MosaicNode, MosaicWithoutDragDropContext } from "react-mosaic-component"; import { makeStyles } from "tss-react/mui"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import { HelpMenu } from "@lichtblick/suite-base/components/AppBar/HelpMenu"; +import { BuiltinIcon } from "@lichtblick/suite-base/components/BuiltinIcon"; +import ErrorBoundary from "@lichtblick/suite-base/components/ErrorBoundary"; +import { MemoryUseIndicator } from "@lichtblick/suite-base/components/MemoryUseIndicator"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; +import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; + import "react-mosaic-component/react-mosaic-component.css"; import { NewSidebar, NewSidebarItem } from "./NewSidebar"; import { TabSpacer } from "./TabSpacer"; diff --git a/packages/suite-base/src/components/Sparkline.stories.tsx b/packages/suite-base/src/components/Sparkline.stories.tsx index c60dd137c9..78daeec5c7 100644 --- a/packages/suite-base/src/components/Sparkline.stories.tsx +++ b/packages/suite-base/src/components/Sparkline.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { Sparkline, SparklinePoint } from "@lichtblick/suite-base/components/Sparkline"; import { StoryObj } from "@storybook/react"; +import { Sparkline, SparklinePoint } from "@lichtblick/suite-base/components/Sparkline"; + const points: SparklinePoint[] = [ { value: 5, timestamp: 10 }, { value: 50, timestamp: 30 }, diff --git a/packages/suite-base/src/components/Sparkline.tsx b/packages/suite-base/src/components/Sparkline.tsx index 8fe34b2881..1596e3af26 100644 --- a/packages/suite-base/src/components/Sparkline.tsx +++ b/packages/suite-base/src/components/Sparkline.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { Immutable } from "@lichtblick/suite"; -import AutoSizingCanvas from "@lichtblick/suite-base/components/AutoSizingCanvas"; import { useCallback } from "react"; import { makeStyles } from "tss-react/mui"; +import { Immutable } from "@lichtblick/suite"; +import AutoSizingCanvas from "@lichtblick/suite-base/components/AutoSizingCanvas"; + export type SparklinePoint = { value: number; timestamp: number }; type SparklineProps = { diff --git a/packages/suite-base/src/components/Stack.stories.tsx b/packages/suite-base/src/components/Stack.stories.tsx index 5b8bd47fc0..b84d9fac80 100644 --- a/packages/suite-base/src/components/Stack.stories.tsx +++ b/packages/suite-base/src/components/Stack.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/Stack.tsx b/packages/suite-base/src/components/Stack.tsx index e0e3d7f363..55b598a475 100644 --- a/packages/suite-base/src/components/Stack.tsx +++ b/packages/suite-base/src/components/Stack.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/StudioLogsSettings/StudioLogsSettings.tsx b/packages/suite-base/src/components/StudioLogsSettings/StudioLogsSettings.tsx index a30739c07c..d2e7deadc4 100644 --- a/packages/suite-base/src/components/StudioLogsSettings/StudioLogsSettings.tsx +++ b/packages/suite-base/src/components/StudioLogsSettings/StudioLogsSettings.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/StudioLogsSettings/index.ts b/packages/suite-base/src/components/StudioLogsSettings/index.ts index 998cadcfc5..da24180f2c 100644 --- a/packages/suite-base/src/components/StudioLogsSettings/index.ts +++ b/packages/suite-base/src/components/StudioLogsSettings/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/StudioLogsSettings/useStudioLogsSettingsTree.ts b/packages/suite-base/src/components/StudioLogsSettings/useStudioLogsSettingsTree.ts index 98a532ddf5..dfc0e71656 100644 --- a/packages/suite-base/src/components/StudioLogsSettings/useStudioLogsSettingsTree.ts +++ b/packages/suite-base/src/components/StudioLogsSettings/useStudioLogsSettingsTree.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { extname } from "path"; +import { useMemo } from "react"; + import Log, { toLogLevel } from "@lichtblick/log"; import { SettingsTree, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; import { useStudioLogsSettings } from "@lichtblick/suite-base/context/StudioLogsSettingsContext"; -import { extname } from "path"; -import { useMemo } from "react"; const log = Log.getLogger(__filename); diff --git a/packages/suite-base/src/components/StudioToastProvider.stories.tsx b/packages/suite-base/src/components/StudioToastProvider.stories.tsx index 40aa539cfd..82984588f8 100644 --- a/packages/suite-base/src/components/StudioToastProvider.stories.tsx +++ b/packages/suite-base/src/components/StudioToastProvider.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import StudioToastProvider from "@lichtblick/suite-base/components/StudioToastProvider"; import { StoryFn, StoryObj } from "@storybook/react"; import { useSnackbar } from "notistack"; import { useEffect } from "react"; +import StudioToastProvider from "@lichtblick/suite-base/components/StudioToastProvider"; + export default { title: "components/StudioToastProvider", component: StudioToastProvider, diff --git a/packages/suite-base/src/components/StudioToastProvider.tsx b/packages/suite-base/src/components/StudioToastProvider.tsx index d509ddfa56..01e04c983d 100644 --- a/packages/suite-base/src/components/StudioToastProvider.tsx +++ b/packages/suite-base/src/components/StudioToastProvider.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -9,7 +12,6 @@ import { Info20Regular, Warning20Regular, } from "@fluentui/react-icons"; -import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/components/AppBar/constants"; import { Grow, IconButton } from "@mui/material"; import { SnackbarProvider, @@ -21,6 +23,8 @@ import { import { PropsWithChildren, forwardRef } from "react"; import { makeStyles } from "tss-react/mui"; +import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/components/AppBar/constants"; + const anchorWithOffset = (origin: "top" | "bottom") => ({ "&.notistack-SnackbarContainer": { top: origin === "top" ? APP_BAR_HEIGHT : undefined, diff --git a/packages/suite-base/src/components/SyncAdapters.tsx b/packages/suite-base/src/components/SyncAdapters.tsx index f23c0601fe..d29530b13d 100644 --- a/packages/suite-base/src/components/SyncAdapters.tsx +++ b/packages/suite-base/src/components/SyncAdapters.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo } from "react"; + import { CurrentLayoutLocalStorageSyncAdapter } from "@lichtblick/suite-base/components/CurrentLayoutLocalStorageSyncAdapter"; import { URLStateSyncAdapter } from "@lichtblick/suite-base/components/URLStateSyncAdapter"; import { useAppContext } from "@lichtblick/suite-base/context/AppContext"; -import { useMemo } from "react"; export function SyncAdapters(): JSX.Element { // Sync adapters from app context override any local sync adapters diff --git a/packages/suite-base/src/components/TextContent.tsx b/packages/suite-base/src/components/TextContent.tsx index 36f7a39fbe..2accf465aa 100644 --- a/packages/suite-base/src/components/TextContent.tsx +++ b/packages/suite-base/src/components/TextContent.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,13 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import LinkHandlerContext from "@lichtblick/suite-base/context/LinkHandlerContext"; import { Link } from "@mui/material"; import { CSSProperties, PropsWithChildren, useCallback, useContext } from "react"; import Markdown from "react-markdown"; import rehypeRaw from "rehype-raw"; import { makeStyles } from "tss-react/mui"; +import LinkHandlerContext from "@lichtblick/suite-base/context/LinkHandlerContext"; + const useStyles = makeStyles()(({ palette, shape, spacing, typography, shadows }) => { return { root: { diff --git a/packages/suite-base/src/components/TextHighlight.tsx b/packages/suite-base/src/components/TextHighlight.tsx index fbd73122be..47a783e3d5 100644 --- a/packages/suite-base/src/components/TextHighlight.tsx +++ b/packages/suite-base/src/components/TextHighlight.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TextMiddleTruncate.stories.tsx b/packages/suite-base/src/components/TextMiddleTruncate.stories.tsx index c728fc2799..dc91611758 100644 --- a/packages/suite-base/src/components/TextMiddleTruncate.stories.tsx +++ b/packages/suite-base/src/components/TextMiddleTruncate.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TextMiddleTruncate.tsx b/packages/suite-base/src/components/TextMiddleTruncate.tsx index e56dd18e17..52ed8afe0c 100644 --- a/packages/suite-base/src/components/TextMiddleTruncate.tsx +++ b/packages/suite-base/src/components/TextMiddleTruncate.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/Downsampler.ts b/packages/suite-base/src/components/TimeBasedChart/Downsampler.ts index d335fa3f42..679e691102 100644 --- a/packages/suite-base/src/components/TimeBasedChart/Downsampler.ts +++ b/packages/suite-base/src/components/TimeBasedChart/Downsampler.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/HoverBar.tsx b/packages/suite-base/src/components/TimeBasedChart/HoverBar.tsx index 877ebb0e13..46ab2dfca0 100644 --- a/packages/suite-base/src/components/TimeBasedChart/HoverBar.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/HoverBar.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.stories.tsx b/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.stories.tsx index b4c408c37b..c2bc91df09 100644 --- a/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.stories.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.tsx b/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.tsx index cbd65b621a..65be597952 100644 --- a/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/TimeBasedChartTooltipContent.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,13 @@ // You may not use this file except in compliance with the License. import { Square12Filled } from "@fluentui/react-icons"; -import { Immutable } from "@lichtblick/suite"; -import Stack from "@lichtblick/suite-base/components/Stack"; import * as _ from "lodash-es"; import { Fragment, PropsWithChildren, useMemo } from "react"; import { makeStyles } from "tss-react/mui"; +import { Immutable } from "@lichtblick/suite"; +import Stack from "@lichtblick/suite-base/components/Stack"; + export type TimeBasedChartTooltipData = { configIndex: number; value: number | bigint | boolean | string; diff --git a/packages/suite-base/src/components/TimeBasedChart/VerticalBarWrapper.tsx b/packages/suite-base/src/components/TimeBasedChart/VerticalBarWrapper.tsx index 3a13e82ec9..7356c044a2 100644 --- a/packages/suite-base/src/components/TimeBasedChart/VerticalBarWrapper.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/VerticalBarWrapper.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { RpcScales } from "@lichtblick/suite-base/components/Chart/types"; import { CSSProperties, useMemo } from "react"; import { makeStyles } from "tss-react/mui"; +import { RpcScales } from "@lichtblick/suite-base/components/Chart/types"; + const useStyles = makeStyles()(() => ({ root: { top: 0, diff --git a/packages/suite-base/src/components/TimeBasedChart/downsample.test.ts b/packages/suite-base/src/components/TimeBasedChart/downsample.test.ts index 510a2ccf47..81db86621e 100644 --- a/packages/suite-base/src/components/TimeBasedChart/downsample.test.ts +++ b/packages/suite-base/src/components/TimeBasedChart/downsample.test.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { iterateObjects } from "@lichtblick/suite-base/components/Chart/datasets"; import * as R from "ramda"; +import { iterateObjects } from "@lichtblick/suite-base/components/Chart/datasets"; + import { MINIMUM_PIXEL_DISTANCE, downsampleTimeseries, diff --git a/packages/suite-base/src/components/TimeBasedChart/downsample.ts b/packages/suite-base/src/components/TimeBasedChart/downsample.ts index 0eff1da135..54275f9388 100644 --- a/packages/suite-base/src/components/TimeBasedChart/downsample.ts +++ b/packages/suite-base/src/components/TimeBasedChart/downsample.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/downsampleStates.test.ts b/packages/suite-base/src/components/TimeBasedChart/downsampleStates.test.ts index c9a74fe98c..2f18c89b32 100644 --- a/packages/suite-base/src/components/TimeBasedChart/downsampleStates.test.ts +++ b/packages/suite-base/src/components/TimeBasedChart/downsampleStates.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/downsampleStates.ts b/packages/suite-base/src/components/TimeBasedChart/downsampleStates.ts index e34bf54d2d..d0b284f7a3 100644 --- a/packages/suite-base/src/components/TimeBasedChart/downsampleStates.ts +++ b/packages/suite-base/src/components/TimeBasedChart/downsampleStates.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as R from "ramda"; + import { Immutable } from "@lichtblick/suite"; import { Point } from "@lichtblick/suite-base/components/Chart/datasets"; -import * as R from "ramda"; import { calculateIntervals } from "./downsample"; import type { PlotViewport } from "./types"; diff --git a/packages/suite-base/src/components/TimeBasedChart/getBounds.test.ts b/packages/suite-base/src/components/TimeBasedChart/getBounds.test.ts index 4a196a0261..1bc20e66af 100644 --- a/packages/suite-base/src/components/TimeBasedChart/getBounds.test.ts +++ b/packages/suite-base/src/components/TimeBasedChart/getBounds.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TimeBasedChart/index.stories.tsx b/packages/suite-base/src/components/TimeBasedChart/index.stories.tsx index c103de8ad4..ff8e2080ce 100644 --- a/packages/suite-base/src/components/TimeBasedChart/index.stories.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,16 +13,17 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; -import { triggerWheel } from "@lichtblick/suite-base/stories/PanelSetup"; -import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; -import delay from "@lichtblick/suite-base/util/delay"; import { StoryObj } from "@storybook/react"; import { useCallback, useEffect, useRef, useState } from "react"; import TestUtils from "react-dom/test-utils"; import { useAsync } from "react-use"; import { useImmer } from "use-immer"; +import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; +import { triggerWheel } from "@lichtblick/suite-base/stories/PanelSetup"; +import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; +import delay from "@lichtblick/suite-base/util/delay"; + import type { Props } from "./index"; import TimeBasedChart from "./index"; diff --git a/packages/suite-base/src/components/TimeBasedChart/index.tsx b/packages/suite-base/src/components/TimeBasedChart/index.tsx index 12849b8d3c..62b906f18e 100644 --- a/packages/suite-base/src/components/TimeBasedChart/index.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,20 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { filterMap } from "@lichtblick/den/collection"; -import Logger from "@lichtblick/log"; -import ChartComponent from "@lichtblick/suite-base/components/Chart/index"; -import { RpcElement, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; -import KeyListener from "@lichtblick/suite-base/components/KeyListener"; -import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { - TimelineInteractionStateStore, - useClearHoverValue, - useSetHoverValue, - useTimelineInteractionState, -} from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; -import { Bounds } from "@lichtblick/suite-base/types/Bounds"; +import type { ZoomOptions } from "@foxglove/chartjs-plugin-zoom/types/options"; +import { fontMonospace } from "@foxglove/theme"; import { Button, Fade, Tooltip, buttonClasses } from "@mui/material"; import { ChartOptions, InteractionMode, ScaleOptions } from "chart.js"; import { AnnotationOptions } from "chartjs-plugin-annotation"; @@ -43,8 +34,20 @@ import { useMountedState } from "react-use"; import { makeStyles } from "tss-react/mui"; import { v4 as uuidv4 } from "uuid"; -import type { ZoomOptions } from "@foxglove/chartjs-plugin-zoom/types/options"; -import { fontMonospace } from "@foxglove/theme"; +import { filterMap } from "@lichtblick/den/collection"; +import Logger from "@lichtblick/log"; +import ChartComponent from "@lichtblick/suite-base/components/Chart/index"; +import { RpcElement, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; +import KeyListener from "@lichtblick/suite-base/components/KeyListener"; +import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { + TimelineInteractionStateStore, + useClearHoverValue, + useSetHoverValue, + useTimelineInteractionState, +} from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; +import { Bounds } from "@lichtblick/suite-base/types/Bounds"; import HoverBar from "./HoverBar"; import TimeBasedChartTooltipContent, { diff --git a/packages/suite-base/src/components/TimeBasedChart/types.ts b/packages/suite-base/src/components/TimeBasedChart/types.ts index 615c1c40cd..197a6d2b3b 100644 --- a/packages/suite-base/src/components/TimeBasedChart/types.ts +++ b/packages/suite-base/src/components/TimeBasedChart/types.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import type { ChartData as AbstractChartData } from "chart.js"; + import type { ObjectData, ChartData, TypedChartData, TypedData, } from "@lichtblick/suite-base/components/Chart/types"; -import type { ChartData as AbstractChartData } from "chart.js"; // alias types for convenience export type ChartDatasets = ChartData["datasets"]; diff --git a/packages/suite-base/src/components/TimeBasedChart/useDownsampler.tsx b/packages/suite-base/src/components/TimeBasedChart/useDownsampler.tsx index 68f1b67c87..ebce0a077d 100644 --- a/packages/suite-base/src/components/TimeBasedChart/useDownsampler.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/useDownsampler.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { ObjectData, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; import React, { useMemo, useCallback, useEffect } from "react"; import { useDebouncedCallback } from "use-debounce"; +import type { ObjectData, RpcScales } from "@lichtblick/suite-base/components/Chart/types"; + import { Downsampler } from "./Downsampler"; import { PlotDataProvider, ProviderStateSetter, PlotViewport, ChartDataset } from "./types"; import { getBounds } from "./useProvider"; diff --git a/packages/suite-base/src/components/TimeBasedChart/useProvider.tsx b/packages/suite-base/src/components/TimeBasedChart/useProvider.tsx index 62f638f09e..b93a0d050e 100644 --- a/packages/suite-base/src/components/TimeBasedChart/useProvider.tsx +++ b/packages/suite-base/src/components/TimeBasedChart/useProvider.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { iterateObjects, iterateTyped } from "@lichtblick/suite-base/components/Chart/datasets"; -import type { ObjectData, TypedData } from "@lichtblick/suite-base/components/Chart/types"; import { ChartDataset, ChartData } from "chart.js"; import * as R from "ramda"; import { useEffect, useMemo, useCallback } from "react"; +import { iterateObjects, iterateTyped } from "@lichtblick/suite-base/components/Chart/datasets"; +import type { ObjectData, TypedData } from "@lichtblick/suite-base/components/Chart/types"; + import { PlotDataProvider, ProviderState, Bounds, PlotViewport } from "./types"; type Datasets = ChartDataset<"scatter", T>[]; diff --git a/packages/suite-base/src/components/Timestamp.stories.tsx b/packages/suite-base/src/components/Timestamp.stories.tsx index 7a8edbb835..ed61c5530d 100644 --- a/packages/suite-base/src/components/Timestamp.stories.tsx +++ b/packages/suite-base/src/components/Timestamp.stories.tsx @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import Timestamp from "@lichtblick/suite-base/components/Timestamp"; -import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; -import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; +import { Time } from "@foxglove/rostime"; import { Stack } from "@mui/material"; import { StoryObj } from "@storybook/react"; import { PropsWithChildren, useState } from "react"; -import { Time } from "@foxglove/rostime"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import Timestamp from "@lichtblick/suite-base/components/Timestamp"; +import AppConfigurationContext from "@lichtblick/suite-base/context/AppConfigurationContext"; +import { makeMockAppConfiguration } from "@lichtblick/suite-base/util/makeMockAppConfiguration"; const ABSOLUTE_TIME = { sec: 1643800942, nsec: 222222222 }; const RELATIVE_TIME = { sec: 630720000, nsec: 597648236 }; diff --git a/packages/suite-base/src/components/Timestamp.tsx b/packages/suite-base/src/components/Timestamp.tsx index 3f910bcb65..6183fad2e6 100644 --- a/packages/suite-base/src/components/Timestamp.tsx +++ b/packages/suite-base/src/components/Timestamp.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import { isAbsoluteTime, formatTimeRaw } from "@lichtblick/suite-base/util/time"; +import { Time } from "@foxglove/rostime"; import { Typography } from "@mui/material"; import { useMemo } from "react"; import { makeStyles } from "tss-react/mui"; -import { Time } from "@foxglove/rostime"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; +import { isAbsoluteTime, formatTimeRaw } from "@lichtblick/suite-base/util/time"; type Props = { disableDate?: boolean; diff --git a/packages/suite-base/src/components/TopicList/ContextMenu.tsx b/packages/suite-base/src/components/TopicList/ContextMenu.tsx index 9f2fa7ab68..ee5f62615e 100644 --- a/packages/suite-base/src/components/TopicList/ContextMenu.tsx +++ b/packages/suite-base/src/components/TopicList/ContextMenu.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { Menu, MenuItem, MenuItemProps, MenuProps } from "@mui/material"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { useCopyToClipboard } from "react-use"; +import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; + export function ContextMenu(props: { messagePaths: DraggedMessagePath[]; anchorPosition: NonNullable; diff --git a/packages/suite-base/src/components/TopicList/MessagePathRow.tsx b/packages/suite-base/src/components/TopicList/MessagePathRow.tsx index 7bff5a7b9b..5035f97f45 100644 --- a/packages/suite-base/src/components/TopicList/MessagePathRow.tsx +++ b/packages/suite-base/src/components/TopicList/MessagePathRow.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ReOrderDotsVertical16Regular } from "@fluentui/react-icons"; +import { Badge, Typography } from "@mui/material"; +import { FzfResultItem } from "fzf"; +import { useCallback, useMemo } from "react"; + import { HighlightChars } from "@lichtblick/suite-base/components/HighlightChars"; import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import Stack from "@lichtblick/suite-base/components/Stack"; import { useMessagePathDrag } from "@lichtblick/suite-base/services/messagePathDragging"; -import { Badge, Typography } from "@mui/material"; -import { FzfResultItem } from "fzf"; -import { useCallback, useMemo } from "react"; import { MessagePathSearchItem } from "./getMessagePathSearchItems"; import { useTopicListStyles } from "./useTopicListStyles"; diff --git a/packages/suite-base/src/components/TopicList/TopicList.stories.tsx b/packages/suite-base/src/components/TopicList/TopicList.stories.tsx index 99361b7f4e..4542bdadec 100644 --- a/packages/suite-base/src/components/TopicList/TopicList.stories.tsx +++ b/packages/suite-base/src/components/TopicList/TopicList.stories.tsx @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; -import { PlayerCapabilities, TopicStats } from "@lichtblick/suite-base/players/types"; +import { ros2humble } from "@foxglove/rosmsg-msgs-common"; import { Meta, StoryObj } from "@storybook/react"; import { fireEvent, userEvent, waitFor, within } from "@storybook/testing-library"; import * as _ from "lodash-es"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; -import { ros2humble } from "@foxglove/rosmsg-msgs-common"; +import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; +import { PlayerCapabilities, TopicStats } from "@lichtblick/suite-base/players/types"; import { TopicList } from "./TopicList"; diff --git a/packages/suite-base/src/components/TopicList/TopicList.tsx b/packages/suite-base/src/components/TopicList/TopicList.tsx index e051f16123..764b0df182 100644 --- a/packages/suite-base/src/components/TopicList/TopicList.tsx +++ b/packages/suite-base/src/components/TopicList/TopicList.tsx @@ -1,19 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { filterMap } from "@lichtblick/den/collection"; -import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; -import { DirectTopicStatsUpdater } from "@lichtblick/suite-base/components/DirectTopicStatsUpdater"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import { - MessagePipelineContext, - useMessagePipeline, -} from "@lichtblick/suite-base/components/MessagePipeline"; -import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; -import { ContextMenu } from "@lichtblick/suite-base/components/TopicList/ContextMenu"; -import { PlayerPresence } from "@lichtblick/suite-base/players/types"; -import { MessagePathSelectionProvider } from "@lichtblick/suite-base/services/messagePathDragging/MessagePathSelectionProvider"; +import { quoteTopicNameIfNeeded } from "@foxglove/message-path"; import ClearIcon from "@mui/icons-material/Clear"; import SearchIcon from "@mui/icons-material/Search"; import { @@ -33,7 +25,18 @@ import { ListChildComponentProps, VariableSizeList } from "react-window"; import { makeStyles } from "tss-react/mui"; import { useDebounce } from "use-debounce"; -import { quoteTopicNameIfNeeded } from "@foxglove/message-path"; +import { filterMap } from "@lichtblick/den/collection"; +import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; +import { DirectTopicStatsUpdater } from "@lichtblick/suite-base/components/DirectTopicStatsUpdater"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import { + MessagePipelineContext, + useMessagePipeline, +} from "@lichtblick/suite-base/components/MessagePipeline"; +import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; +import { ContextMenu } from "@lichtblick/suite-base/components/TopicList/ContextMenu"; +import { PlayerPresence } from "@lichtblick/suite-base/players/types"; +import { MessagePathSelectionProvider } from "@lichtblick/suite-base/services/messagePathDragging/MessagePathSelectionProvider"; import { MessagePathRow } from "./MessagePathRow"; import { TopicRow } from "./TopicRow"; diff --git a/packages/suite-base/src/components/TopicList/TopicRow.tsx b/packages/suite-base/src/components/TopicList/TopicRow.tsx index 7c22235db4..da5f64e326 100644 --- a/packages/suite-base/src/components/TopicList/TopicRow.tsx +++ b/packages/suite-base/src/components/TopicList/TopicRow.tsx @@ -1,18 +1,21 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { ReOrderDotsVertical16Regular } from "@fluentui/react-icons"; +import { quoteTopicNameIfNeeded } from "@foxglove/message-path"; +import { Badge, Typography } from "@mui/material"; +import { FzfResultItem } from "fzf"; +import { useCallback, useMemo } from "react"; + import { HighlightChars } from "@lichtblick/suite-base/components/HighlightChars"; import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import Stack from "@lichtblick/suite-base/components/Stack"; import { Topic } from "@lichtblick/suite-base/players/types"; import { useMessagePathDrag } from "@lichtblick/suite-base/services/messagePathDragging"; -import { Badge, Typography } from "@mui/material"; -import { FzfResultItem } from "fzf"; -import { useCallback, useMemo } from "react"; - -import { quoteTopicNameIfNeeded } from "@foxglove/message-path"; import { TopicStatsChip } from "./TopicStatsChip"; import { useTopicListStyles } from "./useTopicListStyles"; diff --git a/packages/suite-base/src/components/TopicList/TopicStatsChip.tsx b/packages/suite-base/src/components/TopicList/TopicStatsChip.tsx index 2d2faf86cb..e1334aa94c 100644 --- a/packages/suite-base/src/components/TopicList/TopicStatsChip.tsx +++ b/packages/suite-base/src/components/TopicList/TopicStatsChip.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.test.ts b/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.test.ts index 166f55de7c..aff63764ea 100644 --- a/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.test.ts +++ b/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.test.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { getMessagePathSearchItems } from "@lichtblick/suite-base/components/TopicList/getMessagePathSearchItems"; -import { Topic } from "@lichtblick/suite-base/players/types"; - import { parseChannel } from "@foxglove/mcap-support"; import { MessageDefinition } from "@foxglove/message-definition"; import { ImageAnnotations } from "@foxglove/schemas/jsonschema"; +import { getMessagePathSearchItems } from "@lichtblick/suite-base/components/TopicList/getMessagePathSearchItems"; +import { Topic } from "@lichtblick/suite-base/players/types"; + describe("getMessagePathSearchItems", () => { it("returns items with correct paths and types", () => { const schemasByName: ReadonlyMap = new Map([ diff --git a/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.ts b/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.ts index f07a676404..f5f0669af3 100644 --- a/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.ts +++ b/packages/suite-base/src/components/TopicList/getMessagePathSearchItems.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; -import * as _ from "lodash-es"; - import { MessageDefinition } from "@foxglove/message-definition"; import { quoteFieldNameIfNeeded, quoteTopicNameIfNeeded } from "@foxglove/message-path"; +import * as _ from "lodash-es"; + +import { Immutable } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/src/players/types"; /** diff --git a/packages/suite-base/src/components/TopicList/index.ts b/packages/suite-base/src/components/TopicList/index.ts index c4661da797..81411313ad 100644 --- a/packages/suite-base/src/components/TopicList/index.ts +++ b/packages/suite-base/src/components/TopicList/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TopicList/useMultiSelection.ts b/packages/suite-base/src/components/TopicList/useMultiSelection.ts index 082dc46803..3f1a5f5ff0 100644 --- a/packages/suite-base/src/components/TopicList/useMultiSelection.ts +++ b/packages/suite-base/src/components/TopicList/useMultiSelection.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TopicList/useTopicListSearch.test.ts b/packages/suite-base/src/components/TopicList/useTopicListSearch.test.ts index 848127715a..80bf2f7484 100644 --- a/packages/suite-base/src/components/TopicList/useTopicListSearch.test.ts +++ b/packages/suite-base/src/components/TopicList/useTopicListSearch.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/TopicList/useTopicListSearch.ts b/packages/suite-base/src/components/TopicList/useTopicListSearch.ts index bef3fddbe8..309bb603ea 100644 --- a/packages/suite-base/src/components/TopicList/useTopicListSearch.ts +++ b/packages/suite-base/src/components/TopicList/useTopicListSearch.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; +import { MessageDefinition } from "@foxglove/message-definition"; import { Fzf, FzfResultItem, basicMatch } from "fzf"; import * as _ from "lodash-es"; import { useMemo } from "react"; -import { MessageDefinition } from "@foxglove/message-definition"; +import { Immutable } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; import { MessagePathSearchItem, getMessagePathSearchItems } from "./getMessagePathSearchItems"; diff --git a/packages/suite-base/src/components/TopicList/useTopicListStyles.ts b/packages/suite-base/src/components/TopicList/useTopicListStyles.ts index 2efb899d96..c592227ff0 100644 --- a/packages/suite-base/src/components/TopicList/useTopicListStyles.ts +++ b/packages/suite-base/src/components/TopicList/useTopicListStyles.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/URLStateSyncAdapter.tsx b/packages/suite-base/src/components/URLStateSyncAdapter.tsx index db47ba7055..7d56fa4f70 100644 --- a/packages/suite-base/src/components/URLStateSyncAdapter.tsx +++ b/packages/suite-base/src/components/URLStateSyncAdapter.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/UnknownPanel.tsx b/packages/suite-base/src/components/UnknownPanel.tsx index e10bc76477..44a92fc808 100644 --- a/packages/suite-base/src/components/UnknownPanel.tsx +++ b/packages/suite-base/src/components/UnknownPanel.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/VariablesList/Variable.tsx b/packages/suite-base/src/components/VariablesList/Variable.tsx index cf506105e5..8f6a5f3c40 100644 --- a/packages/suite-base/src/components/VariablesList/Variable.tsx +++ b/packages/suite-base/src/components/VariablesList/Variable.tsx @@ -1,16 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { VariableValue } from "@lichtblick/suite"; -import CopyButton from "@lichtblick/suite-base/components/CopyButton"; -import JsonInput from "@lichtblick/suite-base/components/JsonInput"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; -import useGlobalVariables, { - GlobalVariables, -} from "@lichtblick/suite-base/hooks/useGlobalVariables"; -import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown"; import ErrorIcon from "@mui/icons-material/Error"; import MoreVertIcon from "@mui/icons-material/MoreVert"; @@ -31,6 +25,16 @@ import * as _ from "lodash-es"; import { useMemo, useCallback, useState, useRef } from "react"; import { makeStyles } from "tss-react/mui"; +import { VariableValue } from "@lichtblick/suite"; +import CopyButton from "@lichtblick/suite-base/components/CopyButton"; +import JsonInput from "@lichtblick/suite-base/components/JsonInput"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; +import useGlobalVariables, { + GlobalVariables, +} from "@lichtblick/suite-base/hooks/useGlobalVariables"; +import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; + const useStyles = makeStyles()((theme, _params, classes) => ({ root: { "@media (pointer: fine)": { diff --git a/packages/suite-base/src/components/VariablesList/index.stories.tsx b/packages/suite-base/src/components/VariablesList/index.stories.tsx index 725a8120a6..81b41f8dc4 100644 --- a/packages/suite-base/src/components/VariablesList/index.stories.tsx +++ b/packages/suite-base/src/components/VariablesList/index.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { StoryObj } from "@storybook/react"; import { fireEvent, screen } from "@storybook/testing-library"; import { DndProvider } from "react-dnd"; import { HTML5Backend } from "react-dnd-html5-backend"; +import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; + import VariablesList from "."; export default { diff --git a/packages/suite-base/src/components/VariablesList/index.tsx b/packages/suite-base/src/components/VariablesList/index.tsx index 2e0fa1a223..1c99f80ad9 100644 --- a/packages/suite-base/src/components/VariablesList/index.tsx +++ b/packages/suite-base/src/components/VariablesList/index.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Button } from "@mui/material"; +import * as _ from "lodash-es"; +import { useMemo, useRef, useState, ReactElement, useEffect } from "react"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { useAnalytics } from "@lichtblick/suite-base/context/AnalyticsContext"; import useGlobalVariables, { GlobalVariables, } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; -import { Button } from "@mui/material"; -import * as _ from "lodash-es"; -import { useMemo, useRef, useState, ReactElement, useEffect } from "react"; import Variable from "./Variable"; diff --git a/packages/suite-base/src/components/WorkspaceDialogs.tsx b/packages/suite-base/src/components/WorkspaceDialogs.tsx index cef5ca08a0..bd97c9ae31 100644 --- a/packages/suite-base/src/components/WorkspaceDialogs.tsx +++ b/packages/suite-base/src/components/WorkspaceDialogs.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/WssErrorModal.stories.tsx b/packages/suite-base/src/components/WssErrorModal.stories.tsx index bce6be6691..1a1ec7f569 100644 --- a/packages/suite-base/src/components/WssErrorModal.stories.tsx +++ b/packages/suite-base/src/components/WssErrorModal.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/components/WssErrorModal.tsx b/packages/suite-base/src/components/WssErrorModal.tsx index c9f588e6be..3e90a72001 100644 --- a/packages/suite-base/src/components/WssErrorModal.tsx +++ b/packages/suite-base/src/components/WssErrorModal.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable } from "@lichtblick/suite"; -import { PlayerProblem } from "@lichtblick/suite-base/players/types"; import CloseIcon from "@mui/icons-material/Close"; import { Dialog, DialogContent, DialogTitle, IconButton, Stack, Typography } from "@mui/material"; import { useState } from "react"; import { makeStyles } from "tss-react/mui"; +import { Immutable } from "@lichtblick/suite"; +import { PlayerProblem } from "@lichtblick/suite-base/players/types"; + import WssErrorModalScreenshot from "./WssErrorModal.png"; const useStyles = makeStyles()({ diff --git a/packages/suite-base/src/constants/localStorageKeys.ts b/packages/suite-base/src/constants/localStorageKeys.ts index ecb9f20916..88cab22655 100644 --- a/packages/suite-base/src/constants/localStorageKeys.ts +++ b/packages/suite-base/src/constants/localStorageKeys.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/AnalyticsContext.ts b/packages/suite-base/src/context/AnalyticsContext.ts index 63a22bf165..8ad211b4f8 100644 --- a/packages/suite-base/src/context/AnalyticsContext.ts +++ b/packages/suite-base/src/context/AnalyticsContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useContext } from "react"; + import IAnalytics from "@lichtblick/suite-base/services/IAnalytics"; import NullAnalytics from "@lichtblick/suite-base/services/NullAnalytics"; -import { createContext, useContext } from "react"; const AnalyticsContext = createContext(new NullAnalytics()); AnalyticsContext.displayName = "AnalyticsContext"; diff --git a/packages/suite-base/src/context/AppConfigurationContext.ts b/packages/suite-base/src/context/AppConfigurationContext.ts index ade4cee524..0044551596 100644 --- a/packages/suite-base/src/context/AppConfigurationContext.ts +++ b/packages/suite-base/src/context/AppConfigurationContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/AppContext.ts b/packages/suite-base/src/context/AppContext.ts index 51151d374a..b4ff030c6f 100644 --- a/packages/suite-base/src/context/AppContext.ts +++ b/packages/suite-base/src/context/AppContext.ts @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useContext } from "react"; +import { DeepPartial } from "ts-essentials"; +import { StoreApi } from "zustand"; + import { Immutable, SettingsTreeField, SettingsTreeNode } from "@lichtblick/suite"; import { AppBarMenuItem } from "@lichtblick/suite-base/components/AppBar/types"; import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { WorkspaceContextStore } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import type { SceneExtensionConfig } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtensionConfig"; import type { Player } from "@lichtblick/suite-base/players/types"; -import { createContext, useContext } from "react"; -import { DeepPartial } from "ts-essentials"; -import { StoreApi } from "zustand"; interface IAppContext { appBarLayoutButton?: JSX.Element; diff --git a/packages/suite-base/src/context/BaseUserContext.ts b/packages/suite-base/src/context/BaseUserContext.ts index b6fb34fb36..e8ac6e7150 100644 --- a/packages/suite-base/src/context/BaseUserContext.ts +++ b/packages/suite-base/src/context/BaseUserContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/CurrentLayoutContext/actions.ts b/packages/suite-base/src/context/CurrentLayoutContext/actions.ts index bbcd7b6e5e..30e8c56845 100644 --- a/packages/suite-base/src/context/CurrentLayoutContext/actions.ts +++ b/packages/suite-base/src/context/CurrentLayoutContext/actions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { MosaicNode, MosaicPath } from "react-mosaic-component"; + import { VariableValue } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { TabLocation } from "@lichtblick/suite-base/types/layouts"; @@ -21,7 +26,6 @@ import { SavedProps, UserScripts, } from "@lichtblick/suite-base/types/panels"; -import { MosaicNode, MosaicPath } from "react-mosaic-component"; export type LayoutData = { // We store config for each panel in an object keyed by the panel id. diff --git a/packages/suite-base/src/context/CurrentLayoutContext/index.ts b/packages/suite-base/src/context/CurrentLayoutContext/index.ts index 12145773d0..1a7b17adb5 100644 --- a/packages/suite-base/src/context/CurrentLayoutContext/index.ts +++ b/packages/suite-base/src/context/CurrentLayoutContext/index.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useCallback, useLayoutEffect, useReducer, useRef, useState } from "react"; +import { getLeaves } from "react-mosaic-component"; + import { selectWithUnstableIdentityWarning, useGuaranteedContext, @@ -12,8 +18,6 @@ import { RenderState, VariableValue } from "@lichtblick/suite"; import useShouldNotChangeOften from "@lichtblick/suite-base/hooks/useShouldNotChangeOften"; import toggleSelectedPanel from "@lichtblick/suite-base/providers/CurrentLayoutProvider/toggleSelectedPanel"; import { PanelConfig, PlaybackConfig, UserScripts } from "@lichtblick/suite-base/types/panels"; -import { createContext, useCallback, useLayoutEffect, useReducer, useRef, useState } from "react"; -import { getLeaves } from "react-mosaic-component"; import { AddPanelPayload, diff --git a/packages/suite-base/src/context/CurrentLayoutContext/useCurrentLayoutSelector.test.tsx b/packages/suite-base/src/context/CurrentLayoutContext/useCurrentLayoutSelector.test.tsx index 583b0c491b..a025d497fe 100644 --- a/packages/suite-base/src/context/CurrentLayoutContext/useCurrentLayoutSelector.test.tsx +++ b/packages/suite-base/src/context/CurrentLayoutContext/useCurrentLayoutSelector.test.tsx @@ -1,11 +1,15 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; import { act, renderHook } from "@testing-library/react"; import { useLayoutEffect, useRef } from "react"; +import MockCurrentLayoutProvider from "@lichtblick/suite-base/providers/CurrentLayoutProvider/MockCurrentLayoutProvider"; + import { LayoutState, useCurrentLayoutActions, useCurrentLayoutSelector } from "./index"; describe("useCurrentLayoutSelector", () => { diff --git a/packages/suite-base/src/context/CurrentUserContext.ts b/packages/suite-base/src/context/CurrentUserContext.ts index fcee417449..0b46c0349d 100644 --- a/packages/suite-base/src/context/CurrentUserContext.ts +++ b/packages/suite-base/src/context/CurrentUserContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/EventsContext.ts b/packages/suite-base/src/context/EventsContext.ts index 754292a68a..2e2435dc04 100644 --- a/packages/suite-base/src/context/EventsContext.ts +++ b/packages/suite-base/src/context/EventsContext.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useGuaranteedContext } from "@lichtblick/hooks"; -import { Immutable } from "@lichtblick/suite"; +import { Time } from "@foxglove/rostime"; import { createContext } from "react"; import { AsyncState } from "react-use/lib/useAsyncFn"; import { StoreApi, useStore } from "zustand"; -import { Time } from "@foxglove/rostime"; +import { useGuaranteedContext } from "@lichtblick/hooks"; +import { Immutable } from "@lichtblick/suite"; /** * DataSourceEvent representings a single event within a data source. @@ -73,7 +76,7 @@ export type EventsStore = Immutable<{ setEvents: (events: AsyncState) => void; /** Set the flag indicating support for events. */ - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters setEventsSupported: (supported: boolean) => void; /** Update the current filter expression. */ diff --git a/packages/suite-base/src/context/ExtensionCatalogContext.ts b/packages/suite-base/src/context/ExtensionCatalogContext.ts index 64e52264a5..8eddf3700c 100644 --- a/packages/suite-base/src/context/ExtensionCatalogContext.ts +++ b/packages/suite-base/src/context/ExtensionCatalogContext.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext } from "react"; +import { StoreApi, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { ExtensionPanelRegistration, @@ -10,8 +16,6 @@ import { } from "@lichtblick/suite"; import { TopicAliasFunctions } from "@lichtblick/suite-base/players/TopicAliasingPlayer/TopicAliasingPlayer"; import { ExtensionInfo, ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; -import { createContext } from "react"; -import { StoreApi, useStore } from "zustand"; export type RegisteredPanel = { extensionName: string; diff --git a/packages/suite-base/src/context/ExtensionMarketplaceContext.ts b/packages/suite-base/src/context/ExtensionMarketplaceContext.ts index 8b2b1671f7..a610c1e494 100644 --- a/packages/suite-base/src/context/ExtensionMarketplaceContext.ts +++ b/packages/suite-base/src/context/ExtensionMarketplaceContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; import { createContext, useContext } from "react"; +import { ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; + export type ExtensionMarketplaceDetail = { id: string; name: string; diff --git a/packages/suite-base/src/context/LayoutManagerContext.ts b/packages/suite-base/src/context/LayoutManagerContext.ts index 3ae0f62270..c58c5d033a 100644 --- a/packages/suite-base/src/context/LayoutManagerContext.ts +++ b/packages/suite-base/src/context/LayoutManagerContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { ILayoutManager } from "@lichtblick/suite-base/services/ILayoutManager"; import { createContext, useContext } from "react"; +import { ILayoutManager } from "@lichtblick/suite-base/services/ILayoutManager"; + const LayoutManagerContext = createContext(undefined); LayoutManagerContext.displayName = "LayoutManagerContext"; diff --git a/packages/suite-base/src/context/LayoutStorageContext.ts b/packages/suite-base/src/context/LayoutStorageContext.ts index 95fa4bd78a..c1260bb4cf 100644 --- a/packages/suite-base/src/context/LayoutStorageContext.ts +++ b/packages/suite-base/src/context/LayoutStorageContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { ILayoutStorage } from "@lichtblick/suite-base/services/ILayoutStorage"; import { createContext, useContext } from "react"; +import { ILayoutStorage } from "@lichtblick/suite-base/services/ILayoutStorage"; + const LayoutStorageContext = createContext(undefined); LayoutStorageContext.displayName = "LayoutStorageContext"; diff --git a/packages/suite-base/src/context/LinkHandlerContext.ts b/packages/suite-base/src/context/LinkHandlerContext.ts index 00d69c904b..7428512186 100644 --- a/packages/suite-base/src/context/LinkHandlerContext.ts +++ b/packages/suite-base/src/context/LinkHandlerContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/NativeAppMenuContext.ts b/packages/suite-base/src/context/NativeAppMenuContext.ts index 5ddefbf714..d2ddda947a 100644 --- a/packages/suite-base/src/context/NativeAppMenuContext.ts +++ b/packages/suite-base/src/context/NativeAppMenuContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/NativeWindowContext.ts b/packages/suite-base/src/context/NativeWindowContext.ts index c0ba4cf0e8..499f48eebf 100644 --- a/packages/suite-base/src/context/NativeWindowContext.ts +++ b/packages/suite-base/src/context/NativeWindowContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/PanelCatalogContext.ts b/packages/suite-base/src/context/PanelCatalogContext.ts index 99c62ae9b1..bd39208b9a 100644 --- a/packages/suite-base/src/context/PanelCatalogContext.ts +++ b/packages/suite-base/src/context/PanelCatalogContext.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ComponentType, createContext, useContext } from "react"; + import { PanelStatics } from "@lichtblick/suite-base/components/Panel"; import { ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; import { PanelConfig } from "@lichtblick/suite-base/types/panels"; -import { ComponentType, createContext, useContext } from "react"; export type PanelComponent = ComponentType<{ childId?: string; tabId?: string }> & PanelStatics; diff --git a/packages/suite-base/src/context/PanelStateContext.ts b/packages/suite-base/src/context/PanelStateContext.ts index 92fe17aadd..96514b059c 100644 --- a/packages/suite-base/src/context/PanelStateContext.ts +++ b/packages/suite-base/src/context/PanelStateContext.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useGuaranteedContext } from "@lichtblick/hooks"; -import { Immutable, SettingsTree } from "@lichtblick/suite"; import { createContext } from "react"; import { StoreApi, useStore } from "zustand"; +import { useGuaranteedContext } from "@lichtblick/hooks"; +import { Immutable, SettingsTree } from "@lichtblick/suite"; + export type ImmutableSettingsTree = Immutable; export type PanelStateStore = { diff --git a/packages/suite-base/src/context/PerformanceContext.ts b/packages/suite-base/src/context/PerformanceContext.ts index 48273cd110..6cbd6abd4e 100644 --- a/packages/suite-base/src/context/PerformanceContext.ts +++ b/packages/suite-base/src/context/PerformanceContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/PlayerSelectionContext.ts b/packages/suite-base/src/context/PlayerSelectionContext.ts index 00ce760b11..64f1a2d64c 100644 --- a/packages/suite-base/src/context/PlayerSelectionContext.ts +++ b/packages/suite-base/src/context/PlayerSelectionContext.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useContext } from "react"; + import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { Player, PlayerMetricsCollectorInterface } from "@lichtblick/suite-base/players/types"; import { RegisteredIconNames } from "@lichtblick/suite-base/types/Icons"; -import { createContext, useContext } from "react"; export type DataSourceFactoryInitializeArgs = { metricsCollector: PlayerMetricsCollectorInterface; diff --git a/packages/suite-base/src/context/ProblemsContext.ts b/packages/suite-base/src/context/ProblemsContext.ts index 93f377078e..51c982f5d6 100644 --- a/packages/suite-base/src/context/ProblemsContext.ts +++ b/packages/suite-base/src/context/ProblemsContext.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext } from "react"; +import { StoreApi, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { Immutable } from "@lichtblick/suite"; import { PlayerProblem } from "@lichtblick/suite-base/players/types"; -import { createContext } from "react"; -import { StoreApi, useStore } from "zustand"; export type SessionProblem = PlayerProblem; diff --git a/packages/suite-base/src/context/RemoteLayoutStorageContext.ts b/packages/suite-base/src/context/RemoteLayoutStorageContext.ts index ac8a287374..7b4961f4d6 100644 --- a/packages/suite-base/src/context/RemoteLayoutStorageContext.ts +++ b/packages/suite-base/src/context/RemoteLayoutStorageContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { IRemoteLayoutStorage } from "@lichtblick/suite-base/services/IRemoteLayoutStorage"; import { createContext, useContext } from "react"; +import { IRemoteLayoutStorage } from "@lichtblick/suite-base/services/IRemoteLayoutStorage"; + const RemoteLayoutStorageContext = createContext(undefined); RemoteLayoutStorageContext.displayName = "RemoteLayoutStorageContext"; diff --git a/packages/suite-base/src/context/SharedRootContext.ts b/packages/suite-base/src/context/SharedRootContext.ts index 4d246dfb34..9c6ae74fcf 100644 --- a/packages/suite-base/src/context/SharedRootContext.ts +++ b/packages/suite-base/src/context/SharedRootContext.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useContext } from "react"; + import { AppBarProps } from "@lichtblick/suite-base/components/AppBar"; import { CustomWindowControlsProps } from "@lichtblick/suite-base/components/AppBar/CustomWindowControls"; import { IAppConfiguration } from "@lichtblick/suite-base/context/AppConfigurationContext"; @@ -9,7 +14,6 @@ import { INativeAppMenu } from "@lichtblick/suite-base/context/NativeAppMenuCont import { INativeWindow } from "@lichtblick/suite-base/context/NativeWindowContext"; import { IDataSourceFactory } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import { ExtensionLoader } from "@lichtblick/suite-base/services/ExtensionLoader"; -import { createContext, useContext } from "react"; interface ISharedRootContext { deepLinks: readonly string[]; diff --git a/packages/suite-base/src/context/StudioLogsSettingsContext.ts b/packages/suite-base/src/context/StudioLogsSettingsContext.ts index 83df92293e..b4f4f67251 100644 --- a/packages/suite-base/src/context/StudioLogsSettingsContext.ts +++ b/packages/suite-base/src/context/StudioLogsSettingsContext.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useGuaranteedContext } from "@lichtblick/hooks"; -import { LogLevel } from "@lichtblick/log"; import { createContext } from "react"; import { StoreApi, useStore } from "zustand"; +import { useGuaranteedContext } from "@lichtblick/hooks"; +import { LogLevel } from "@lichtblick/log"; + type StudioLogConfigChannel = { name: string; enabled: boolean }; interface IStudioLogsSettings { diff --git a/packages/suite-base/src/context/TimelineInteractionStateContext.tsx b/packages/suite-base/src/context/TimelineInteractionStateContext.tsx index 3452f52d54..57877e51b4 100644 --- a/packages/suite-base/src/context/TimelineInteractionStateContext.tsx +++ b/packages/suite-base/src/context/TimelineInteractionStateContext.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { createContext, useCallback } from "react"; +import { StoreApi, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { Immutable } from "@lichtblick/suite"; import { TimelinePositionedEvent } from "@lichtblick/suite-base/context/EventsContext"; import type { HoverValue } from "@lichtblick/suite-base/types/hoverValue"; -import { createContext, useCallback } from "react"; -import { StoreApi, useStore } from "zustand"; /** * Represents the global bounds to which synced plots conform, including the id of the diff --git a/packages/suite-base/src/context/UserProfileStorageContext.ts b/packages/suite-base/src/context/UserProfileStorageContext.ts index f40755f78e..fd8541894e 100644 --- a/packages/suite-base/src/context/UserProfileStorageContext.ts +++ b/packages/suite-base/src/context/UserProfileStorageContext.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { createContext, useContext } from "react"; +import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; + export type UserProfile = { /** The id of the layout the user is currently working with. */ currentLayoutId?: LayoutID; diff --git a/packages/suite-base/src/context/UserScriptStateContext.tsx b/packages/suite-base/src/context/UserScriptStateContext.tsx index 2dbd5df90d..e8f0d5b2f2 100644 --- a/packages/suite-base/src/context/UserScriptStateContext.tsx +++ b/packages/suite-base/src/context/UserScriptStateContext.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext, useState } from "react"; +import { StoreApi, createStore, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { generateEmptyTypesLib } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/generateTypesLib"; import { ros_lib_dts } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/ros"; import { Diagnostic, UserScriptLog } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; -import { createContext, useState } from "react"; -import { StoreApi, createStore, useStore } from "zustand"; type UserScriptState = { rosLib: string; diff --git a/packages/suite-base/src/context/Workspace/WorkspaceContext.ts b/packages/suite-base/src/context/Workspace/WorkspaceContext.ts index 9c6b15f204..7fa817ee00 100644 --- a/packages/suite-base/src/context/Workspace/WorkspaceContext.ts +++ b/packages/suite-base/src/context/Workspace/WorkspaceContext.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createContext } from "react"; +import { StoreApi, useStore } from "zustand"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { AppSettingsTab } from "@lichtblick/suite-base/components/AppSettingsDialog/AppSettingsDialog"; import { DataSourceDialogItem } from "@lichtblick/suite-base/components/DataSourceDialog"; import { IDataSourceFactory } from "@lichtblick/suite-base/context/PlayerSelectionContext"; -import { createContext } from "react"; -import { StoreApi, useStore } from "zustand"; export const SidebarItemKeys = [ "account", diff --git a/packages/suite-base/src/context/Workspace/migrations.ts b/packages/suite-base/src/context/Workspace/migrations.ts index bcfb5158a8..c2837ca11b 100644 --- a/packages/suite-base/src/context/Workspace/migrations.ts +++ b/packages/suite-base/src/context/Workspace/migrations.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/context/Workspace/useOpenFile.tsx b/packages/suite-base/src/context/Workspace/useOpenFile.tsx index 5d49b0e0c9..a26a721843 100644 --- a/packages/suite-base/src/context/Workspace/useOpenFile.tsx +++ b/packages/suite-base/src/context/Workspace/useOpenFile.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import path from "path"; +import { useCallback, useMemo } from "react"; + import { IDataSourceFactory, usePlayerSelection, } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import showOpenFilePicker from "@lichtblick/suite-base/util/showOpenFilePicker"; -import path from "path"; -import { useCallback, useMemo } from "react"; export function useOpenFile(sources: readonly IDataSourceFactory[]): () => Promise { const { selectSource } = usePlayerSelection(); diff --git a/packages/suite-base/src/context/Workspace/useWorkspaceActions.ts b/packages/suite-base/src/context/Workspace/useWorkspaceActions.ts index f44212f229..38546c7c1d 100644 --- a/packages/suite-base/src/context/Workspace/useWorkspaceActions.ts +++ b/packages/suite-base/src/context/Workspace/useWorkspaceActions.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Draft, produce } from "immer"; +import * as _ from "lodash-es"; +import { Dispatch, SetStateAction, useCallback, useMemo } from "react"; +import { useMountedState } from "react-use"; + import { useGuaranteedContext } from "@lichtblick/hooks"; import { AppSettingsTab } from "@lichtblick/suite-base/components/AppSettingsDialog/AppSettingsDialog"; import { DataSourceDialogItem } from "@lichtblick/suite-base/components/DataSourceDialog"; @@ -18,10 +26,6 @@ import { import useCallbackWithToast from "@lichtblick/suite-base/hooks/useCallbackWithToast"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import { downloadTextFile } from "@lichtblick/suite-base/util/download"; -import { Draft, produce } from "immer"; -import * as _ from "lodash-es"; -import { Dispatch, SetStateAction, useCallback, useMemo } from "react"; -import { useMountedState } from "react-use"; import { LeftSidebarItemKey, diff --git a/packages/suite-base/src/dataSources/FoxgloveWebSocketDataSourceFactory.ts b/packages/suite-base/src/dataSources/FoxgloveWebSocketDataSourceFactory.ts index c621d4b03f..4db28a1587 100644 --- a/packages/suite-base/src/dataSources/FoxgloveWebSocketDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/FoxgloveWebSocketDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/McapLocalDataSourceFactory.ts b/packages/suite-base/src/dataSources/McapLocalDataSourceFactory.ts index d42521210b..2250989f1a 100644 --- a/packages/suite-base/src/dataSources/McapLocalDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/McapLocalDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/RemoteDataSourceFactory.tsx b/packages/suite-base/src/dataSources/RemoteDataSourceFactory.tsx index 004b29b920..d45a7119a2 100644 --- a/packages/suite-base/src/dataSources/RemoteDataSourceFactory.tsx +++ b/packages/suite-base/src/dataSources/RemoteDataSourceFactory.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Link } from "@mui/material"; +import path from "path"; + import { IDataSourceFactory, DataSourceFactoryInitializeArgs, @@ -11,8 +17,6 @@ import { WorkerIterableSource, } from "@lichtblick/suite-base/players/IterablePlayer"; import { Player } from "@lichtblick/suite-base/players/types"; -import { Link } from "@mui/material"; -import path from "path"; const initWorkers: Record Worker> = { ".bag": () => { diff --git a/packages/suite-base/src/dataSources/Ros1LocalBagDataSourceFactory.ts b/packages/suite-base/src/dataSources/Ros1LocalBagDataSourceFactory.ts index 07bc422cc1..e8988c7634 100644 --- a/packages/suite-base/src/dataSources/Ros1LocalBagDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/Ros1LocalBagDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/Ros1SocketDataSourceFactory.ts b/packages/suite-base/src/dataSources/Ros1SocketDataSourceFactory.ts index 27cc5edd74..d2e13ed6ca 100644 --- a/packages/suite-base/src/dataSources/Ros1SocketDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/Ros1SocketDataSourceFactory.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { RosNode } from "@foxglove/ros1"; +import * as _ from "lodash-es"; + import OsContextSingleton from "@lichtblick/suite-base/OsContextSingleton"; import { IDataSourceFactory, @@ -9,9 +15,6 @@ import { } from "@lichtblick/suite-base/context/PlayerSelectionContext"; import Ros1Player from "@lichtblick/suite-base/players/Ros1Player"; import { Player } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; - -import { RosNode } from "@foxglove/ros1"; class Ros1SocketDataSourceFactory implements IDataSourceFactory { public id = "ros1-socket"; diff --git a/packages/suite-base/src/dataSources/Ros2LocalBagDataSourceFactory.ts b/packages/suite-base/src/dataSources/Ros2LocalBagDataSourceFactory.ts index 20e163513c..c5d256c39b 100644 --- a/packages/suite-base/src/dataSources/Ros2LocalBagDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/Ros2LocalBagDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/RosbridgeDataSourceFactory.ts b/packages/suite-base/src/dataSources/RosbridgeDataSourceFactory.ts index 1b14b2e081..d35e0d89f2 100644 --- a/packages/suite-base/src/dataSources/RosbridgeDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/RosbridgeDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/SampleNuscenesDataSourceFactory.ts b/packages/suite-base/src/dataSources/SampleNuscenesDataSourceFactory.ts index 41ac4e0cd7..cab3404bdb 100644 --- a/packages/suite-base/src/dataSources/SampleNuscenesDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/SampleNuscenesDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/UlogLocalDataSourceFactory.ts b/packages/suite-base/src/dataSources/UlogLocalDataSourceFactory.ts index 7556c78d95..2c5334a7f0 100644 --- a/packages/suite-base/src/dataSources/UlogLocalDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/UlogLocalDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/dataSources/VelodyneDataSourceFactory.ts b/packages/suite-base/src/dataSources/VelodyneDataSourceFactory.ts index 453a9cfac1..1be311e4be 100644 --- a/packages/suite-base/src/dataSources/VelodyneDataSourceFactory.ts +++ b/packages/suite-base/src/dataSources/VelodyneDataSourceFactory.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/index.ts b/packages/suite-base/src/hooks/index.ts index 5aa4c1414f..3652898961 100644 --- a/packages/suite-base/src/hooks/index.ts +++ b/packages/suite-base/src/hooks/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/useAddPanel.ts b/packages/suite-base/src/hooks/useAddPanel.ts index 9337d261e7..869134e290 100644 --- a/packages/suite-base/src/hooks/useAddPanel.ts +++ b/packages/suite-base/src/hooks/useAddPanel.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback } from "react"; + import { PanelSelection } from "@lichtblick/suite-base/components/PanelCatalog"; import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { getPanelIdForType } from "@lichtblick/suite-base/util/layout"; -import { useCallback } from "react"; export default function useAddPanel(): (selection: PanelSelection) => void { const { addPanel } = useCurrentLayoutActions(); diff --git a/packages/suite-base/src/hooks/useAppConfigurationValue.test.tsx b/packages/suite-base/src/hooks/useAppConfigurationValue.test.tsx index 4c70778f36..ab1c849308 100644 --- a/packages/suite-base/src/hooks/useAppConfigurationValue.test.tsx +++ b/packages/suite-base/src/hooks/useAppConfigurationValue.test.tsx @@ -1,15 +1,19 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { renderHook } from "@testing-library/react"; +import { PropsWithChildren } from "react"; + import AppConfigurationContext, { IAppConfiguration, AppConfigurationValue, } from "@lichtblick/suite-base/context/AppConfigurationContext"; import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks/useAppConfigurationValue"; -import { renderHook } from "@testing-library/react"; -import { PropsWithChildren } from "react"; class FakeProvider implements IAppConfiguration { public get(key: string): AppConfigurationValue { diff --git a/packages/suite-base/src/hooks/useAppConfigurationValue.ts b/packages/suite-base/src/hooks/useAppConfigurationValue.ts index 85fcd67f2f..d64ed6c548 100644 --- a/packages/suite-base/src/hooks/useAppConfigurationValue.ts +++ b/packages/suite-base/src/hooks/useAppConfigurationValue.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback, useEffect, useState } from "react"; + import { AppConfigurationValue, useAppConfiguration, } from "@lichtblick/suite-base/context/AppConfigurationContext"; -import { useCallback, useEffect, useState } from "react"; /** * Load a value from app configuration and provide a function to change it diff --git a/packages/suite-base/src/hooks/useAppTimeFormat.ts b/packages/suite-base/src/hooks/useAppTimeFormat.ts index 18f0117d7e..bfd18e2e66 100644 --- a/packages/suite-base/src/hooks/useAppTimeFormat.ts +++ b/packages/suite-base/src/hooks/useAppTimeFormat.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import moment from "moment-timezone"; +import { useCallback, useMemo } from "react"; + import { Time } from "@lichtblick/suite"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; import { formatDate, formatTime } from "@lichtblick/suite-base/util/formatTime"; import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; -import moment from "moment-timezone"; -import { useCallback, useMemo } from "react"; import { useAppConfigurationValue } from "./useAppConfigurationValue"; diff --git a/packages/suite-base/src/hooks/useCallbackWithToast.ts b/packages/suite-base/src/hooks/useCallbackWithToast.ts index 134bfe04f1..44ab4af516 100644 --- a/packages/suite-base/src/hooks/useCallbackWithToast.ts +++ b/packages/suite-base/src/hooks/useCallbackWithToast.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { useSnackbar } from "notistack"; import { useCallback } from "react"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); /** diff --git a/packages/suite-base/src/hooks/useConfirm.stories.tsx b/packages/suite-base/src/hooks/useConfirm.stories.tsx index 19c9e143c5..ce5738bc70 100644 --- a/packages/suite-base/src/hooks/useConfirm.stories.tsx +++ b/packages/suite-base/src/hooks/useConfirm.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/useConfirm.tsx b/packages/suite-base/src/hooks/useConfirm.tsx index 8c37a1ce1d..f54c6f6fab 100644 --- a/packages/suite-base/src/hooks/useConfirm.tsx +++ b/packages/suite-base/src/hooks/useConfirm.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/useDefaultWebLaunchPreference.ts b/packages/suite-base/src/hooks/useDefaultWebLaunchPreference.ts index 8f21aea10e..3ad965e966 100644 --- a/packages/suite-base/src/hooks/useDefaultWebLaunchPreference.ts +++ b/packages/suite-base/src/hooks/useDefaultWebLaunchPreference.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useEffect } from "react"; + import { useSessionStorageValue } from "@lichtblick/hooks"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import { @@ -10,7 +15,6 @@ import { } from "@lichtblick/suite-base/components/MessagePipeline"; import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import { useEffect } from "react"; const selectHasUrlState = (ctx: MessagePipelineContext) => ctx.playerState.urlState != undefined; diff --git a/packages/suite-base/src/hooks/useElectronFilesToOpen.ts b/packages/suite-base/src/hooks/useElectronFilesToOpen.ts index 6d25a98e9c..c126ff29ab 100644 --- a/packages/suite-base/src/hooks/useElectronFilesToOpen.ts +++ b/packages/suite-base/src/hooks/useElectronFilesToOpen.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { useEffect, useState } from "react"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); // Hook to get any files the main thread has told us to open diff --git a/packages/suite-base/src/hooks/useGlobalVariables.ts b/packages/suite-base/src/hooks/useGlobalVariables.ts index 4779b7d104..bf5da27a48 100644 --- a/packages/suite-base/src/hooks/useGlobalVariables.ts +++ b/packages/suite-base/src/hooks/useGlobalVariables.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/useIndexedDbRecents.test.ts b/packages/suite-base/src/hooks/useIndexedDbRecents.test.ts index 5ba9d320f9..c3f5cffd86 100644 --- a/packages/suite-base/src/hooks/useIndexedDbRecents.test.ts +++ b/packages/suite-base/src/hooks/useIndexedDbRecents.test.ts @@ -1,11 +1,15 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import useIndexedDbRecents from "@lichtblick/suite-base/hooks/useIndexedDbRecents"; import { act, renderHook } from "@testing-library/react"; +import useIndexedDbRecents from "@lichtblick/suite-base/hooks/useIndexedDbRecents"; + describe("useIndexedDbRecents", () => { it("empty recents on mount", () => { const { result, unmount } = renderHook(() => useIndexedDbRecents()); diff --git a/packages/suite-base/src/hooks/useIndexedDbRecents.ts b/packages/suite-base/src/hooks/useIndexedDbRecents.ts index 9239577658..248494b48a 100644 --- a/packages/suite-base/src/hooks/useIndexedDbRecents.ts +++ b/packages/suite-base/src/hooks/useIndexedDbRecents.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { set as idbSet, get as idbGet, createStore as idbCreateStore } from "idb-keyval"; import * as _ from "lodash-es"; import { useCallback, useLayoutEffect, useMemo, useRef, useState } from "react"; import { useAsync } from "react-use"; import { v4 as uuid } from "uuid"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); const IDB_KEY = "recents"; diff --git a/packages/suite-base/src/hooks/usePanelDrag.tsx b/packages/suite-base/src/hooks/usePanelDrag.tsx index af5063e800..7d82e31a1a 100644 --- a/packages/suite-base/src/hooks/usePanelDrag.tsx +++ b/packages/suite-base/src/hooks/usePanelDrag.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,15 +14,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; +import { useContext } from "react"; +import { useDrag, ConnectDragSource, ConnectDragPreview } from "react-dnd"; +import { MosaicDragType, MosaicNode, MosaicWindowContext } from "react-mosaic-component"; + import { useCurrentLayoutActions, usePanelMosaicId, } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { MosaicDropResult, SavedProps } from "@lichtblick/suite-base/types/panels"; -import * as _ from "lodash-es"; -import { useContext } from "react"; -import { useDrag, ConnectDragSource, ConnectDragPreview } from "react-dnd"; -import { MosaicDragType, MosaicNode, MosaicWindowContext } from "react-mosaic-component"; type PanelDragObject = { deferredHide: number; diff --git a/packages/suite-base/src/hooks/usePanelMousePresence.tsx b/packages/suite-base/src/hooks/usePanelMousePresence.tsx index 2612701ee0..96bf5dd511 100644 --- a/packages/suite-base/src/hooks/usePanelMousePresence.tsx +++ b/packages/suite-base/src/hooks/usePanelMousePresence.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; import { MutableRefObject, useCallback, useEffect, useState } from "react"; +import { PANEL_ROOT_CLASS_NAME } from "@lichtblick/suite-base/components/PanelRoot"; + /** * Tracks the presence of the mouse in the parent panel. * diff --git a/packages/suite-base/src/hooks/usePrompt.test.tsx b/packages/suite-base/src/hooks/usePrompt.test.tsx index 3021c54709..46fa85dbc9 100644 --- a/packages/suite-base/src/hooks/usePrompt.test.tsx +++ b/packages/suite-base/src/hooks/usePrompt.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/usePrompt.tsx b/packages/suite-base/src/hooks/usePrompt.tsx index 5d55df966d..67627cd6c5 100644 --- a/packages/suite-base/src/hooks/usePrompt.tsx +++ b/packages/suite-base/src/hooks/usePrompt.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { Button, Dialog, DialogActions, DialogContent, TextField, Typography } from "@mui/material"; import { FormEvent, useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useKeyPressEvent } from "react-use"; +import Stack from "@lichtblick/suite-base/components/Stack"; + type PromptOptions = { title: string; subText?: string; diff --git a/packages/suite-base/src/hooks/usePublisher.tsx b/packages/suite-base/src/hooks/usePublisher.tsx index 3004babf1e..d53c4b9f32 100644 --- a/packages/suite-base/src/hooks/usePublisher.tsx +++ b/packages/suite-base/src/hooks/usePublisher.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useCallback, useEffect, useState } from "react"; +import { v4 as uuidv4 } from "uuid"; + import { Immutable } from "@lichtblick/suite"; import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { useCallback, useEffect, useState } from "react"; -import { v4 as uuidv4 } from "uuid"; type Props = Immutable<{ topic: string; diff --git a/packages/suite-base/src/hooks/useShouldNotChangeOften.test.ts b/packages/suite-base/src/hooks/useShouldNotChangeOften.test.ts index d65dc1ecb0..9ced56c62d 100644 --- a/packages/suite-base/src/hooks/useShouldNotChangeOften.test.ts +++ b/packages/suite-base/src/hooks/useShouldNotChangeOften.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,9 +15,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import useShouldNotChangeOften from "@lichtblick/suite-base/hooks/useShouldNotChangeOften"; import { renderHook } from "@testing-library/react"; +import useShouldNotChangeOften from "@lichtblick/suite-base/hooks/useShouldNotChangeOften"; + describe("useShouldNotChangeOften", () => { it("logs when value changes twice in a row", () => { const warn = jest.fn(); diff --git a/packages/suite-base/src/hooks/useShouldNotChangeOften.ts b/packages/suite-base/src/hooks/useShouldNotChangeOften.ts index d62045e62f..f6c2e5caef 100644 --- a/packages/suite-base/src/hooks/useShouldNotChangeOften.ts +++ b/packages/suite-base/src/hooks/useShouldNotChangeOften.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/hooks/useStateToURLSynchronization.test.tsx b/packages/suite-base/src/hooks/useStateToURLSynchronization.test.tsx index ebf83bdfeb..a9888d53c7 100644 --- a/packages/suite-base/src/hooks/useStateToURLSynchronization.test.tsx +++ b/packages/suite-base/src/hooks/useStateToURLSynchronization.test.tsx @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,11 +15,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { renderHook } from "@testing-library/react"; +import { ReactNode } from "react"; + import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; import { useStateToURLSynchronization } from "@lichtblick/suite-base/hooks/useStateToURLSynchronization"; import EventsProvider from "@lichtblick/suite-base/providers/EventsProvider"; -import { renderHook } from "@testing-library/react"; -import { ReactNode } from "react"; jest.mock("@lichtblick/suite-base/context/CurrentLayoutContext"); jest.mock("@lichtblick/suite-base/components/MessagePipeline"); diff --git a/packages/suite-base/src/hooks/useStateToURLSynchronization.ts b/packages/suite-base/src/hooks/useStateToURLSynchronization.ts index 5b91480d7c..326f2103a3 100644 --- a/packages/suite-base/src/hooks/useStateToURLSynchronization.ts +++ b/packages/suite-base/src/hooks/useStateToURLSynchronization.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { useEffect } from "react"; +import { useDebounce } from "use-debounce"; + import { useDeepMemo } from "@lichtblick/hooks"; import { MessagePipelineContext, @@ -10,9 +17,6 @@ import { import { EventsStore, useEvents } from "@lichtblick/suite-base/context/EventsContext"; import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import { AppURLState, updateAppURLState } from "@lichtblick/suite-base/util/appURLState"; -import * as _ from "lodash-es"; -import { useEffect } from "react"; -import { useDebounce } from "use-debounce"; const selectCanSeek = (ctx: MessagePipelineContext) => ctx.playerState.capabilities.includes(PlayerCapabilities.playbackControl); diff --git a/packages/suite-base/src/hooks/useTopicPublishFrequences.test.tsx b/packages/suite-base/src/hooks/useTopicPublishFrequences.test.tsx index b4576fc1d0..0a38e63846 100644 --- a/packages/suite-base/src/hooks/useTopicPublishFrequences.test.tsx +++ b/packages/suite-base/src/hooks/useTopicPublishFrequences.test.tsx @@ -1,12 +1,16 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { renderHook } from "@testing-library/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import { useTopicPublishFrequencies } from "@lichtblick/suite-base/hooks/useTopicPublishFrequences"; import { PlayerCapabilities, PlayerState } from "@lichtblick/suite-base/players/types"; -import { renderHook } from "@testing-library/react"; describe("useTopicPublishFrequencies", () => { it("calculates frequences for a static source", () => { diff --git a/packages/suite-base/src/hooks/useTopicPublishFrequences.ts b/packages/suite-base/src/hooks/useTopicPublishFrequences.ts index 99094c7d33..e889b296e2 100644 --- a/packages/suite-base/src/hooks/useTopicPublishFrequences.ts +++ b/packages/suite-base/src/hooks/useTopicPublishFrequences.ts @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { subtract as subtractTimes, areEqual, fromMillis, Time, toSec } from "@foxglove/rostime"; +import { useMemo, useRef } from "react"; + import { Immutable } from "@lichtblick/suite"; import { MessagePipelineContext, useMessagePipeline, } from "@lichtblick/suite-base/components/MessagePipeline"; import { PlayerCapabilities, TopicStats } from "@lichtblick/suite-base/players/types"; -import { useMemo, useRef } from "react"; - -import { subtract as subtractTimes, areEqual, fromMillis, Time, toSec } from "@foxglove/rostime"; const EMPTY_TOPIC_STATS = new Map(); diff --git a/packages/suite-base/src/i18n/en/addPanel.ts b/packages/suite-base/src/i18n/en/addPanel.ts index 20030e10ad..98f89f1e9b 100644 --- a/packages/suite-base/src/i18n/en/addPanel.ts +++ b/packages/suite-base/src/i18n/en/addPanel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/appBar.ts b/packages/suite-base/src/i18n/en/appBar.ts index 241ec2e357..eb1f227ff5 100644 --- a/packages/suite-base/src/i18n/en/appBar.ts +++ b/packages/suite-base/src/i18n/en/appBar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/appSettings.ts b/packages/suite-base/src/i18n/en/appSettings.ts index 8842e95f14..16eae5f97f 100644 --- a/packages/suite-base/src/i18n/en/appSettings.ts +++ b/packages/suite-base/src/i18n/en/appSettings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/dataSourceInfo.ts b/packages/suite-base/src/i18n/en/dataSourceInfo.ts index 4201b30516..c2d5c69fc2 100644 --- a/packages/suite-base/src/i18n/en/dataSourceInfo.ts +++ b/packages/suite-base/src/i18n/en/dataSourceInfo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/desktopWindow.ts b/packages/suite-base/src/i18n/en/desktopWindow.ts index b97f140563..2cf3a80bce 100644 --- a/packages/suite-base/src/i18n/en/desktopWindow.ts +++ b/packages/suite-base/src/i18n/en/desktopWindow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/general.ts b/packages/suite-base/src/i18n/en/general.ts index 5ef749b7b7..760a3e7b9a 100644 --- a/packages/suite-base/src/i18n/en/general.ts +++ b/packages/suite-base/src/i18n/en/general.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/incompatibleLayoutVersion.ts b/packages/suite-base/src/i18n/en/incompatibleLayoutVersion.ts index bf70f245ce..69e5e9b642 100644 --- a/packages/suite-base/src/i18n/en/incompatibleLayoutVersion.ts +++ b/packages/suite-base/src/i18n/en/incompatibleLayoutVersion.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/index.ts b/packages/suite-base/src/i18n/en/index.ts index 5c96dbe62e..f217df2745 100644 --- a/packages/suite-base/src/i18n/en/index.ts +++ b/packages/suite-base/src/i18n/en/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/log.ts b/packages/suite-base/src/i18n/en/log.ts index 4cd1fa5a7b..6842756676 100644 --- a/packages/suite-base/src/i18n/en/log.ts +++ b/packages/suite-base/src/i18n/en/log.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/openDialog.ts b/packages/suite-base/src/i18n/en/openDialog.ts index 972e8ac571..70beef9b2d 100644 --- a/packages/suite-base/src/i18n/en/openDialog.ts +++ b/packages/suite-base/src/i18n/en/openDialog.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/panelConfigVersionGuard.ts b/packages/suite-base/src/i18n/en/panelConfigVersionGuard.ts index 698fee8a86..7cdf854b17 100644 --- a/packages/suite-base/src/i18n/en/panelConfigVersionGuard.ts +++ b/packages/suite-base/src/i18n/en/panelConfigVersionGuard.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/panelSettings.ts b/packages/suite-base/src/i18n/en/panelSettings.ts index aa5bbc5c58..c69b65b8ae 100644 --- a/packages/suite-base/src/i18n/en/panelSettings.ts +++ b/packages/suite-base/src/i18n/en/panelSettings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/panelToolbar.ts b/packages/suite-base/src/i18n/en/panelToolbar.ts index 5368fdacce..9ea40fa05f 100644 --- a/packages/suite-base/src/i18n/en/panelToolbar.ts +++ b/packages/suite-base/src/i18n/en/panelToolbar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/panels.ts b/packages/suite-base/src/i18n/en/panels.ts index 4e7124db62..2baac3cdaf 100644 --- a/packages/suite-base/src/i18n/en/panels.ts +++ b/packages/suite-base/src/i18n/en/panels.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/plot.ts b/packages/suite-base/src/i18n/en/plot.ts index 3ab2f1c720..701f5e3064 100644 --- a/packages/suite-base/src/i18n/en/plot.ts +++ b/packages/suite-base/src/i18n/en/plot.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/problemsList.ts b/packages/suite-base/src/i18n/en/problemsList.ts index 01feddb142..ccd51b240b 100644 --- a/packages/suite-base/src/i18n/en/problemsList.ts +++ b/packages/suite-base/src/i18n/en/problemsList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/settingsEditor.ts b/packages/suite-base/src/i18n/en/settingsEditor.ts index 67c3c67771..22f1a06fb0 100644 --- a/packages/suite-base/src/i18n/en/settingsEditor.ts +++ b/packages/suite-base/src/i18n/en/settingsEditor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/stateTransitions.ts b/packages/suite-base/src/i18n/en/stateTransitions.ts index 40283ee5fc..e37d1f1f57 100644 --- a/packages/suite-base/src/i18n/en/stateTransitions.ts +++ b/packages/suite-base/src/i18n/en/stateTransitions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/threeDee.ts b/packages/suite-base/src/i18n/en/threeDee.ts index 2f0ac1644c..ac8c81cb58 100644 --- a/packages/suite-base/src/i18n/en/threeDee.ts +++ b/packages/suite-base/src/i18n/en/threeDee.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/topicList.ts b/packages/suite-base/src/i18n/en/topicList.ts index 76544a9edd..ede3b90a2e 100644 --- a/packages/suite-base/src/i18n/en/topicList.ts +++ b/packages/suite-base/src/i18n/en/topicList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/en/workspace.ts b/packages/suite-base/src/i18n/en/workspace.ts index 900290cb4c..b95d13ee59 100644 --- a/packages/suite-base/src/i18n/en/workspace.ts +++ b/packages/suite-base/src/i18n/en/workspace.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/i18n/index.ts b/packages/suite-base/src/i18n/index.ts index 21881335e0..7c49b26b38 100644 --- a/packages/suite-base/src/i18n/index.ts +++ b/packages/suite-base/src/i18n/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/index.ts b/packages/suite-base/src/index.ts index 6291334a7a..0b3ac73d92 100644 --- a/packages/suite-base/src/index.ts +++ b/packages/suite-base/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/CallService/CallService.tsx b/packages/suite-base/src/panels/CallService/CallService.tsx index a256ad9ad0..92ba537334 100644 --- a/packages/suite-base/src/panels/CallService/CallService.tsx +++ b/packages/suite-base/src/panels/CallService/CallService.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Button, Palette, TextField, Tooltip, Typography, inputBaseClasses } from "@mui/material"; +import { Dispatch, SetStateAction, useCallback, useEffect, useMemo, useState } from "react"; +import { makeStyles } from "tss-react/mui"; + import Log from "@lichtblick/log"; import { PanelExtensionContext, SettingsTreeAction } from "@lichtblick/suite"; import Stack from "@lichtblick/suite-base/components/Stack"; import { Config } from "@lichtblick/suite-base/panels/CallService/types"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import { Button, Palette, TextField, Tooltip, Typography, inputBaseClasses } from "@mui/material"; -import { Dispatch, SetStateAction, useCallback, useEffect, useMemo, useState } from "react"; -import { makeStyles } from "tss-react/mui"; import { defaultConfig, settingsActionReducer, useSettingsTree } from "./settings"; diff --git a/packages/suite-base/src/panels/CallService/index.stories.tsx b/packages/suite-base/src/panels/CallService/index.stories.tsx index 87404f9683..2863c71383 100644 --- a/packages/suite-base/src/panels/CallService/index.stories.tsx +++ b/packages/suite-base/src/panels/CallService/index.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import delay from "@lichtblick/suite-base/util/delay"; import { expect } from "@storybook/jest"; import { StoryContext, StoryFn, StoryObj } from "@storybook/react"; import { userEvent, within } from "@storybook/testing-library"; +import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import delay from "@lichtblick/suite-base/util/delay"; + import CallServicePanel from "./index"; import { Config } from "./types"; diff --git a/packages/suite-base/src/panels/CallService/index.tsx b/packages/suite-base/src/panels/CallService/index.tsx index 754b758494..275ab84900 100644 --- a/packages/suite-base/src/panels/CallService/index.tsx +++ b/packages/suite-base/src/panels/CallService/index.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useMemo } from "react"; + import { useCrash } from "@lichtblick/hooks"; import { PanelExtensionContext } from "@lichtblick/suite"; import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; @@ -9,7 +14,6 @@ import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { StrictMode, useMemo } from "react"; import { CallService } from "./CallService"; import { Config } from "./types"; diff --git a/packages/suite-base/src/panels/CallService/settings.ts b/packages/suite-base/src/panels/CallService/settings.ts index da5fd59156..d382ac61e3 100644 --- a/packages/suite-base/src/panels/CallService/settings.ts +++ b/packages/suite-base/src/panels/CallService/settings.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useShallowMemo } from "@lichtblick/hooks"; -import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; import { produce } from "immer"; import * as _ from "lodash-es"; import { useMemo } from "react"; +import { useShallowMemo } from "@lichtblick/hooks"; +import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; + import { Config } from "./types"; export const defaultConfig: Config = { diff --git a/packages/suite-base/src/panels/CallService/types.ts b/packages/suite-base/src/panels/CallService/types.ts index 14812ee812..68f8beda1e 100644 --- a/packages/suite-base/src/panels/CallService/types.ts +++ b/packages/suite-base/src/panels/CallService/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/DataSourceInfo/index.stories.tsx b/packages/suite-base/src/panels/DataSourceInfo/index.stories.tsx index 0bb0dff114..d4fc85fdd6 100644 --- a/packages/suite-base/src/panels/DataSourceInfo/index.stories.tsx +++ b/packages/suite-base/src/panels/DataSourceInfo/index.stories.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromDate } from "@foxglove/rostime"; +import { StoryObj } from "@storybook/react"; + import MockMessagePipelineProvider from "@lichtblick/suite-base/components/MessagePipeline/MockMessagePipelineProvider"; import DataSourceInfoPanel from "@lichtblick/suite-base/panels/DataSourceInfo"; import { PlayerPresence, Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { fromDate } from "@foxglove/rostime"; export default { title: "panels/DataSourceInfo", diff --git a/packages/suite-base/src/panels/DataSourceInfo/index.tsx b/packages/suite-base/src/panels/DataSourceInfo/index.tsx index 187937a25d..f6168d5605 100644 --- a/packages/suite-base/src/panels/DataSourceInfo/index.tsx +++ b/packages/suite-base/src/panels/DataSourceInfo/index.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Divider, Typography } from "@mui/material"; +import { makeStyles } from "tss-react/mui"; + import CopyButton from "@lichtblick/suite-base/components/CopyButton"; import { DirectTopicStatsUpdater } from "@lichtblick/suite-base/components/DirectTopicStatsUpdater"; import EmptyState from "@lichtblick/suite-base/components/EmptyState"; @@ -12,9 +18,6 @@ import { import Panel from "@lichtblick/suite-base/components/Panel"; import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; import Stack from "@lichtblick/suite-base/components/Stack"; -import { Divider, Typography } from "@mui/material"; -import { makeStyles } from "tss-react/mui"; - import { Topic } from "@lichtblick/suite-base/src/players/types"; const useStyles = makeStyles()((theme, _params, classes) => ({ diff --git a/packages/suite-base/src/panels/Gauge/Gauge.tsx b/packages/suite-base/src/panels/Gauge/Gauge.tsx index 45725381dc..c2a67c66b0 100644 --- a/packages/suite-base/src/panels/Gauge/Gauge.tsx +++ b/packages/suite-base/src/panels/Gauge/Gauge.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent, PanelExtensionContext, SettingsTreeAction } from "@lichtblick/suite"; -import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; -import { turboColorString } from "@lichtblick/suite-base/util/colorUtils"; +import { parseMessagePath, MessagePath } from "@foxglove/message-path"; import * as _ from "lodash-es"; import { useCallback, useEffect, useLayoutEffect, useReducer, useState } from "react"; import { v4 as uuidv4 } from "uuid"; -import { parseMessagePath, MessagePath } from "@foxglove/message-path"; +import { MessageEvent, PanelExtensionContext, SettingsTreeAction } from "@lichtblick/suite"; +import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; +import { turboColorString } from "@lichtblick/suite-base/util/colorUtils"; import { settingsActionReducer, useSettingsTree } from "./settings"; import type { Config } from "./types"; diff --git a/packages/suite-base/src/panels/Gauge/index.stories.tsx b/packages/suite-base/src/panels/Gauge/index.stories.tsx index 6266fbca4b..b5c21a3ec1 100644 --- a/packages/suite-base/src/panels/Gauge/index.stories.tsx +++ b/packages/suite-base/src/panels/Gauge/index.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryFn, StoryContext, StoryObj } from "@storybook/react"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import GaugePanel from "./index"; export default { diff --git a/packages/suite-base/src/panels/Gauge/index.tsx b/packages/suite-base/src/panels/Gauge/index.tsx index 046ec5e1af..5f8f1d20d2 100644 --- a/packages/suite-base/src/panels/Gauge/index.tsx +++ b/packages/suite-base/src/panels/Gauge/index.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useMemo } from "react"; + import { useCrash } from "@lichtblick/hooks"; import { PanelExtensionContext } from "@lichtblick/suite"; import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; @@ -10,7 +15,6 @@ import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelEx import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { StrictMode, useMemo } from "react"; import { Gauge } from "./Gauge"; import { Config } from "./types"; diff --git a/packages/suite-base/src/panels/Gauge/settings.ts b/packages/suite-base/src/panels/Gauge/settings.ts index 797f5bb973..441df2a6dd 100644 --- a/packages/suite-base/src/panels/Gauge/settings.ts +++ b/packages/suite-base/src/panels/Gauge/settings.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useShallowMemo } from "@lichtblick/hooks"; -import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; import { produce } from "immer"; import * as _ from "lodash-es"; import { useMemo } from "react"; +import { useShallowMemo } from "@lichtblick/hooks"; +import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; + import type { Config } from "./types"; export function settingsActionReducer(prevConfig: Config, action: SettingsTreeAction): Config { diff --git a/packages/suite-base/src/panels/Gauge/types.ts b/packages/suite-base/src/panels/Gauge/types.ts index 697e6aebda..485ad6f86c 100644 --- a/packages/suite-base/src/panels/Gauge/types.ts +++ b/packages/suite-base/src/panels/Gauge/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Image/index.tsx b/packages/suite-base/src/panels/Image/index.tsx index 8ec18fdca7..cc2d3d6232 100644 --- a/packages/suite-base/src/panels/Image/index.tsx +++ b/packages/suite-base/src/panels/Image/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Indicator/Indicator.tsx b/packages/suite-base/src/panels/Indicator/Indicator.tsx index f0bf46b674..a93416de64 100644 --- a/packages/suite-base/src/panels/Indicator/Indicator.tsx +++ b/packages/suite-base/src/panels/Indicator/Indicator.tsx @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent, PanelExtensionContext, SettingsTreeAction } from "@lichtblick/suite"; -import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; -import Stack from "@lichtblick/suite-base/components/Stack"; +import { MessagePath, parseMessagePath } from "@foxglove/message-path"; import { Typography } from "@mui/material"; import * as _ from "lodash-es"; import { useCallback, useEffect, useLayoutEffect, useMemo, useReducer, useState } from "react"; import { makeStyles } from "tss-react/mui"; -import { MessagePath, parseMessagePath } from "@foxglove/message-path"; +import { MessageEvent, PanelExtensionContext, SettingsTreeAction } from "@lichtblick/suite"; +import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; +import Stack from "@lichtblick/suite-base/components/Stack"; import { getMatchingRule } from "./getMatchingRule"; import { settingsActionReducer, useSettingsTree } from "./settings"; diff --git a/packages/suite-base/src/panels/Indicator/getMatchingRule.test.ts b/packages/suite-base/src/panels/Indicator/getMatchingRule.test.ts index 62587c47b4..6193bbf9ff 100644 --- a/packages/suite-base/src/panels/Indicator/getMatchingRule.test.ts +++ b/packages/suite-base/src/panels/Indicator/getMatchingRule.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Indicator/getMatchingRule.ts b/packages/suite-base/src/panels/Indicator/getMatchingRule.ts index 2407d817e9..831e830bcf 100644 --- a/packages/suite-base/src/panels/Indicator/getMatchingRule.ts +++ b/packages/suite-base/src/panels/Indicator/getMatchingRule.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Indicator/index.stories.tsx b/packages/suite-base/src/panels/Indicator/index.stories.tsx index c36d68f8da..872b72f0c3 100644 --- a/packages/suite-base/src/panels/Indicator/index.stories.tsx +++ b/packages/suite-base/src/panels/Indicator/index.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryFn, StoryContext, StoryObj } from "@storybook/react"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import Indicator from "./index"; export default { diff --git a/packages/suite-base/src/panels/Indicator/index.tsx b/packages/suite-base/src/panels/Indicator/index.tsx index 85144fde36..682c38ec4b 100644 --- a/packages/suite-base/src/panels/Indicator/index.tsx +++ b/packages/suite-base/src/panels/Indicator/index.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useMemo } from "react"; + import { useCrash } from "@lichtblick/hooks"; import { PanelExtensionContext } from "@lichtblick/suite"; import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; @@ -10,7 +15,6 @@ import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelEx import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { StrictMode, useMemo } from "react"; import { Indicator } from "./Indicator"; import { Config } from "./types"; diff --git a/packages/suite-base/src/panels/Indicator/settings.ts b/packages/suite-base/src/panels/Indicator/settings.ts index 9f2c5d946a..d64acd6ba5 100644 --- a/packages/suite-base/src/panels/Indicator/settings.ts +++ b/packages/suite-base/src/panels/Indicator/settings.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { produce } from "immer"; +import * as _ from "lodash-es"; +import memoizeWeak from "memoize-weak"; +import { useMemo } from "react"; + import { useShallowMemo } from "@lichtblick/hooks"; import { SettingsTreeAction, @@ -9,10 +17,6 @@ import { SettingsTreeNodeAction, SettingsTreeNodes, } from "@lichtblick/suite"; -import { produce } from "immer"; -import * as _ from "lodash-es"; -import memoizeWeak from "memoize-weak"; -import { useMemo } from "react"; import { Config, Rule } from "./types"; diff --git a/packages/suite-base/src/panels/Indicator/types.ts b/packages/suite-base/src/panels/Indicator/types.ts index 673217b306..808f83e9f6 100644 --- a/packages/suite-base/src/panels/Indicator/types.ts +++ b/packages/suite-base/src/panels/Indicator/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Log/FilterTagInput.tsx b/packages/suite-base/src/panels/Log/FilterTagInput.tsx index 5f96802e56..381087176a 100644 --- a/packages/suite-base/src/panels/Log/FilterTagInput.tsx +++ b/packages/suite-base/src/panels/Log/FilterTagInput.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Log/LevelToString.ts b/packages/suite-base/src/panels/Log/LevelToString.ts index f083fda8da..63eca91c4f 100644 --- a/packages/suite-base/src/panels/Log/LevelToString.ts +++ b/packages/suite-base/src/panels/Log/LevelToString.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Log/LogList.tsx b/packages/suite-base/src/panels/Log/LogList.tsx index 33dd0aea2c..5ea5ffcaf8 100644 --- a/packages/suite-base/src/panels/Log/LogList.tsx +++ b/packages/suite-base/src/panels/Log/LogList.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,8 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; -import { NormalizedLogMessage } from "@lichtblick/suite-base/panels/Log/types"; import DoubleArrowDownIcon from "@mui/icons-material/KeyboardDoubleArrowDown"; import { Fab } from "@mui/material"; import { CSSProperties, useCallback, useEffect, useMemo, useRef, useState } from "react"; @@ -22,6 +23,9 @@ import { AutoSizer } from "react-virtualized"; import { VariableSizeList as List } from "react-window"; import { makeStyles } from "tss-react/mui"; +import { useAppTimeFormat } from "@lichtblick/suite-base/hooks"; +import { NormalizedLogMessage } from "@lichtblick/suite-base/panels/Log/types"; + import LogMessage from "./LogMessage"; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/panels/Log/LogMessage.tsx b/packages/suite-base/src/panels/Log/LogMessage.tsx index 97281dce04..359bc8ff87 100644 --- a/packages/suite-base/src/panels/Log/LogMessage.tsx +++ b/packages/suite-base/src/panels/Log/LogMessage.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import useLogStyles from "@lichtblick/suite-base/panels/Log/useLogStyles"; -import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; import * as _ from "lodash-es"; import { makeStyles } from "tss-react/mui"; +import useLogStyles from "@lichtblick/suite-base/panels/Log/useLogStyles"; +import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; + import LevelToString from "./LevelToString"; import Stamp from "./Stamp"; import { NormalizedLogMessage } from "./types"; diff --git a/packages/suite-base/src/panels/Log/Stamp.tsx b/packages/suite-base/src/panels/Log/Stamp.tsx index fe75ad94fc..6b929ff7dc 100644 --- a/packages/suite-base/src/panels/Log/Stamp.tsx +++ b/packages/suite-base/src/panels/Log/Stamp.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; + import { Time } from "@lichtblick/suite"; import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; import { formatTime } from "@lichtblick/suite-base/util/formatTime"; -import * as _ from "lodash-es"; // pad the start of `val` with 0's to make the total string length `count` size function PadStart(val: unknown, count: number) { diff --git a/packages/suite-base/src/panels/Log/conversion.tsx b/packages/suite-base/src/panels/Log/conversion.tsx index 53bc52625f..68c8c9d42a 100644 --- a/packages/suite-base/src/panels/Log/conversion.tsx +++ b/packages/suite-base/src/panels/Log/conversion.tsx @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Time } from "@lichtblick/suite"; - import { fromNanoSec } from "@foxglove/rostime"; import { Log as FoxgloveLog } from "@foxglove/schemas"; +import { Time } from "@lichtblick/suite"; + import { Ros1RosgraphMsgs$Log, LogLevel, diff --git a/packages/suite-base/src/panels/Log/filterMessages.test.ts b/packages/suite-base/src/panels/Log/filterMessages.test.ts index 8d6a009685..28cf3074d1 100644 --- a/packages/suite-base/src/panels/Log/filterMessages.test.ts +++ b/packages/suite-base/src/panels/Log/filterMessages.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Log/filterMessages.ts b/packages/suite-base/src/panels/Log/filterMessages.ts index faf8dcc365..de273e841f 100644 --- a/packages/suite-base/src/panels/Log/filterMessages.ts +++ b/packages/suite-base/src/panels/Log/filterMessages.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Log/index.stories.tsx b/packages/suite-base/src/panels/Log/index.stories.tsx index a91fd608f0..46568aaa5c 100644 --- a/packages/suite-base/src/panels/Log/index.stories.tsx +++ b/packages/suite-base/src/panels/Log/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Log from "@lichtblick/suite-base/panels/Log"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryObj } from "@storybook/react"; import * as _ from "lodash-es"; +import Log from "@lichtblick/suite-base/panels/Log"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; + const fixture: Fixture = { topics: [{ name: "/rosout", schemaName: "rosgraph_msgs/Log" }], frame: { diff --git a/packages/suite-base/src/panels/Log/index.tsx b/packages/suite-base/src/panels/Log/index.tsx index 7c2a04a1f6..6676925194 100644 --- a/packages/suite-base/src/panels/Log/index.tsx +++ b/packages/suite-base/src/panels/Log/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Divider } from "@mui/material"; +import { produce } from "immer"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useMemo, useRef } from "react"; +import { useTranslation } from "react-i18next"; + import { SettingsTreeAction } from "@lichtblick/suite"; import { useDataSourceInfo, useMessagesByTopic } from "@lichtblick/suite-base/PanelAPI"; import Panel from "@lichtblick/suite-base/components/Panel"; @@ -20,11 +29,6 @@ import { FilterTagInput } from "@lichtblick/suite-base/panels/Log/FilterTagInput import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; -import { Divider } from "@mui/material"; -import { produce } from "immer"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useMemo, useRef } from "react"; -import { useTranslation } from "react-i18next"; import LogList from "./LogList"; import { normalizedLogMessage } from "./conversion"; diff --git a/packages/suite-base/src/panels/Log/settings.ts b/packages/suite-base/src/panels/Log/settings.ts index 3f17e7d4da..419e9a2c2e 100644 --- a/packages/suite-base/src/panels/Log/settings.ts +++ b/packages/suite-base/src/panels/Log/settings.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { TFunction } from "i18next"; + import { SettingsTreeChildren, SettingsTreeNodes } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; -import { TFunction } from "i18next"; import { LogLevel } from "./types"; diff --git a/packages/suite-base/src/panels/Log/types.ts b/packages/suite-base/src/panels/Log/types.ts index c59ae66708..216ed33393 100644 --- a/packages/suite-base/src/panels/Log/types.ts +++ b/packages/suite-base/src/panels/Log/types.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Log as FoxgloveLog } from "@foxglove/schemas"; + import { Time, MessageEvent } from "@lichtblick/suite"; import { Header } from "@lichtblick/suite-base/types/Messages"; -import { Log as FoxgloveLog } from "@foxglove/schemas"; - export type Config = { searchTerms: string[]; minLogLevel: number; diff --git a/packages/suite-base/src/panels/Log/useLogStyles.ts b/packages/suite-base/src/panels/Log/useLogStyles.ts index 75f1f47fc9..2dca23ec32 100644 --- a/packages/suite-base/src/panels/Log/useLogStyles.ts +++ b/packages/suite-base/src/panels/Log/useLogStyles.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Map/FilteredPointLayer.ts b/packages/suite-base/src/panels/Map/FilteredPointLayer.ts index 9885b3508e..439a45778a 100644 --- a/packages/suite-base/src/panels/Map/FilteredPointLayer.ts +++ b/packages/suite-base/src/panels/Map/FilteredPointLayer.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { Map, LatLngBounds, FeatureGroup, CircleMarker, PathOptions, Ellipse } from "leaflet"; +import { MessageEvent } from "@lichtblick/suite-base/players/types"; + import "leaflet-ellipse"; import { getAccuracy } from "./getAccuracy"; import { NavSatFixMsg } from "./types"; diff --git a/packages/suite-base/src/panels/Map/MapPanel.tsx b/packages/suite-base/src/panels/Map/MapPanel.tsx index 2db22c05ab..ef10a3dec0 100644 --- a/packages/suite-base/src/panels/Map/MapPanel.tsx +++ b/packages/suite-base/src/panels/Map/MapPanel.tsx @@ -1,22 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { filterMap } from "@lichtblick/den/collection"; -import { - MessageEvent, - PanelExtensionContext, - SettingsTreeAction, - Subscription, - Topic, -} from "@lichtblick/suite"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import FilteredPointLayer, { - POINT_MARKER_RADIUS, -} from "@lichtblick/suite-base/panels/Map/FilteredPointLayer"; -import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import { darkColor, lightColor, lineColors } from "@lichtblick/suite-base/util/plotColors"; +import { toSec } from "@foxglove/rostime"; import { Feature } from "geojson"; import { produce } from "immer"; import { @@ -35,7 +24,21 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } fr import { useResizeDetector } from "react-resize-detector"; import { useDebouncedCallback } from "use-debounce"; -import { toSec } from "@foxglove/rostime"; +import { filterMap } from "@lichtblick/den/collection"; +import { + MessageEvent, + PanelExtensionContext, + SettingsTreeAction, + Subscription, + Topic, +} from "@lichtblick/suite"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import FilteredPointLayer, { + POINT_MARKER_RADIUS, +} from "@lichtblick/suite-base/panels/Map/FilteredPointLayer"; +import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; +import { darkColor, lightColor, lineColors } from "@lichtblick/suite-base/util/plotColors"; import { buildSettingsTree, Config, validateCustomUrl } from "./config"; import { diff --git a/packages/suite-base/src/panels/Map/config.ts b/packages/suite-base/src/panels/Map/config.ts index 7b0ba14316..0224844ea1 100644 --- a/packages/suite-base/src/panels/Map/config.ts +++ b/packages/suite-base/src/panels/Map/config.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; + import { filterMap } from "@lichtblick/den/collection"; import { SettingsTreeFields, SettingsTreeNodes, Topic } from "@lichtblick/suite"; -import * as _ from "lodash-es"; // Persisted panel state export type Config = { diff --git a/packages/suite-base/src/panels/Map/getAccuracy.test.ts b/packages/suite-base/src/panels/Map/getAccuracy.test.ts index 352960897c..f389446d7e 100644 --- a/packages/suite-base/src/panels/Map/getAccuracy.test.ts +++ b/packages/suite-base/src/panels/Map/getAccuracy.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Map/getAccuracy.ts b/packages/suite-base/src/panels/Map/getAccuracy.ts index f438a62837..72dfdd4147 100644 --- a/packages/suite-base/src/panels/Map/getAccuracy.ts +++ b/packages/suite-base/src/panels/Map/getAccuracy.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MathNumericType, atan2, eigs, isNumber } from "mathjs"; + import { NavSatFixMsg, NavSatFixPositionCovarianceType, } from "@lichtblick/suite-base/panels/Map/types"; -import { MathNumericType, atan2, eigs, isNumber } from "mathjs"; type NumericPair = [MathNumericType, MathNumericType]; diff --git a/packages/suite-base/src/panels/Map/index.stories.tsx b/packages/suite-base/src/panels/Map/index.stories.tsx index 61edef9352..28c20deacc 100644 --- a/packages/suite-base/src/panels/Map/index.stories.tsx +++ b/packages/suite-base/src/panels/Map/index.stories.tsx @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryFn, StoryContext, StoryObj } from "@storybook/react"; +import { userEvent } from "@storybook/testing-library"; +import * as _ from "lodash-es"; +import { useState } from "react"; +import { useTimeoutFn } from "react-use"; + import { NavSatFixMsg, NavSatFixPositionCovarianceType, @@ -10,11 +19,6 @@ import { } from "@lichtblick/suite-base/panels/Map/types"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryFn, StoryContext, StoryObj } from "@storybook/react"; -import { userEvent } from "@storybook/testing-library"; -import * as _ from "lodash-es"; -import { useState } from "react"; -import { useTimeoutFn } from "react-use"; import MapPanel from "./index"; diff --git a/packages/suite-base/src/panels/Map/index.tsx b/packages/suite-base/src/panels/Map/index.tsx index 82a934fdd4..ce273cef6f 100644 --- a/packages/suite-base/src/panels/Map/index.tsx +++ b/packages/suite-base/src/panels/Map/index.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo } from "react"; + import { useCrash } from "@lichtblick/hooks"; import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { useMemo } from "react"; import { initPanel } from "./initPanel"; diff --git a/packages/suite-base/src/panels/Map/initPanel.tsx b/packages/suite-base/src/panels/Map/initPanel.tsx index 2cac333bd7..49e195ca15 100644 --- a/packages/suite-base/src/panels/Map/initPanel.tsx +++ b/packages/suite-base/src/panels/Map/initPanel.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useCrash } from "@lichtblick/hooks"; -import { PanelExtensionContext } from "@lichtblick/suite"; -import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; -import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import L from "leaflet"; import LeafletRetinaIconUrl from "leaflet/dist/images/marker-icon-2x.png"; import LeafletIconUrl from "leaflet/dist/images/marker-icon.png"; import LeafletShadowIconUrl from "leaflet/dist/images/marker-shadow.png"; +import { useCrash } from "@lichtblick/hooks"; +import { PanelExtensionContext } from "@lichtblick/suite"; +import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; +import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; + import MapPanel from "./MapPanel"; import "leaflet/dist/leaflet.css"; diff --git a/packages/suite-base/src/panels/Map/support.ts b/packages/suite-base/src/panels/Map/support.ts index 65bdac7ac2..59c088ceda 100644 --- a/packages/suite-base/src/panels/Map/support.ts +++ b/packages/suite-base/src/panels/Map/support.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { FoxgloveMessages } from "@lichtblick/suite-base/types/FoxgloveMessages"; import { Feature, FeatureCollection, GeoJsonObject } from "geojson"; import { PathOptions, geoJSON } from "leaflet"; +import { MessageEvent } from "@lichtblick/suite"; +import { FoxgloveMessages } from "@lichtblick/suite-base/types/FoxgloveMessages"; + import { MapPanelMessage, NavSatFixMsg, NavSatFixStatus } from "./types"; export type GeoJsonMessage = MessageEvent; diff --git a/packages/suite-base/src/panels/Map/types.ts b/packages/suite-base/src/panels/Map/types.ts index b25351b343..948612d0cd 100644 --- a/packages/suite-base/src/panels/Map/types.ts +++ b/packages/suite-base/src/panels/Map/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Parameters/index.stories.tsx b/packages/suite-base/src/panels/Parameters/index.stories.tsx index b86852c086..ca02127ab4 100644 --- a/packages/suite-base/src/panels/Parameters/index.stories.tsx +++ b/packages/suite-base/src/panels/Parameters/index.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { useState } from "react"; + import { ParameterValue } from "@lichtblick/suite"; import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { useState } from "react"; import Parameters from "./index"; diff --git a/packages/suite-base/src/panels/Parameters/index.tsx b/packages/suite-base/src/panels/Parameters/index.tsx index e8d80cd502..599af1cfa6 100644 --- a/packages/suite-base/src/panels/Parameters/index.tsx +++ b/packages/suite-base/src/panels/Parameters/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,18 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { ParameterValue } from "@lichtblick/suite"; -import CopyButton from "@lichtblick/suite-base/components/CopyButton"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import JsonInput from "@lichtblick/suite-base/components/JsonInput"; -import { - MessagePipelineContext, - useMessagePipeline, -} from "@lichtblick/suite-base/components/MessagePipeline"; -import Panel from "@lichtblick/suite-base/components/Panel"; -import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import CheckIcon from "@mui/icons-material/Check"; import ClearIcon from "@mui/icons-material/Clear"; import { @@ -41,6 +32,19 @@ import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from import { makeStyles } from "tss-react/mui"; import { useDebouncedCallback } from "use-debounce"; +import { ParameterValue } from "@lichtblick/suite"; +import CopyButton from "@lichtblick/suite-base/components/CopyButton"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import JsonInput from "@lichtblick/suite-base/components/JsonInput"; +import { + MessagePipelineContext, + useMessagePipeline, +} from "@lichtblick/suite-base/components/MessagePipeline"; +import Panel from "@lichtblick/suite-base/components/Panel"; +import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; + // The minimum amount of time to wait between showing the parameter update animation again const ANIMATION_RESET_DELAY_MS = 3000; diff --git a/packages/suite-base/src/panels/PlaybackPerformance/index.stories.tsx b/packages/suite-base/src/panels/PlaybackPerformance/index.stories.tsx index f4817ecec1..8e2f40f2cf 100644 --- a/packages/suite-base/src/panels/PlaybackPerformance/index.stories.tsx +++ b/packages/suite-base/src/panels/PlaybackPerformance/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryObj } from "@storybook/react"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import PlaybackPerformance from "./index"; export default { diff --git a/packages/suite-base/src/panels/PlaybackPerformance/index.tsx b/packages/suite-base/src/panels/PlaybackPerformance/index.tsx index de311f4c60..662427711b 100644 --- a/packages/suite-base/src/panels/PlaybackPerformance/index.tsx +++ b/packages/suite-base/src/panels/PlaybackPerformance/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { subtract as subtractTimes, toSec } from "@foxglove/rostime"; +import { Typography } from "@mui/material"; +import * as _ from "lodash-es"; +import { ReactElement } from "react"; + import { Immutable } from "@lichtblick/suite"; import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; import Panel from "@lichtblick/suite-base/components/Panel"; @@ -18,11 +26,6 @@ import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; import { Sparkline, SparklinePoint } from "@lichtblick/suite-base/components/Sparkline"; import Stack from "@lichtblick/suite-base/components/Stack"; import { PlayerStateActiveData } from "@lichtblick/suite-base/players/types"; -import { Typography } from "@mui/material"; -import * as _ from "lodash-es"; -import { ReactElement } from "react"; - -import { subtract as subtractTimes, toSec } from "@foxglove/rostime"; const TIME_RANGE = 5000; diff --git a/packages/suite-base/src/panels/Plot/ChartRenderer.ts b/packages/suite-base/src/panels/Plot/ChartRenderer.ts index 5eea922dc7..02f9841508 100644 --- a/packages/suite-base/src/panels/Plot/ChartRenderer.ts +++ b/packages/suite-base/src/panels/Plot/ChartRenderer.ts @@ -1,17 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { unwrap } from "@lichtblick/den/monads"; -import { Immutable } from "@lichtblick/suite"; -import { Bounds, Bounds1D } from "@lichtblick/suite-base/types/Bounds"; -import { maybeCast } from "@lichtblick/suite-base/util/maybeCast"; +import { Zoom as ZoomPlugin } from "@foxglove/chartjs-plugin-zoom"; +import { fontMonospace } from "@foxglove/theme"; import { Chart, ChartDataset, ChartOptions, ScatterDataPoint } from "chart.js"; import { AnnotationOptions } from "chartjs-plugin-annotation"; import EventEmitter from "eventemitter3"; -import { Zoom as ZoomPlugin } from "@foxglove/chartjs-plugin-zoom"; -import { fontMonospace } from "@foxglove/theme"; +import { unwrap } from "@lichtblick/den/monads"; +import { Immutable } from "@lichtblick/suite"; +import { Bounds, Bounds1D } from "@lichtblick/suite-base/types/Bounds"; +import { maybeCast } from "@lichtblick/suite-base/util/maybeCast"; import { OriginalValue } from "./datum"; diff --git a/packages/suite-base/src/panels/Plot/ChartRenderer.worker.ts b/packages/suite-base/src/panels/Plot/ChartRenderer.worker.ts index f9edd5c873..28cabfc6e1 100644 --- a/packages/suite-base/src/panels/Plot/ChartRenderer.worker.ts +++ b/packages/suite-base/src/panels/Plot/ChartRenderer.worker.ts @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import PlexMono from "@lichtblick/suite-base/styles/assets/PlexMono.woff2"; import { CategoryScale, Chart, @@ -19,6 +21,8 @@ import { import AnnotationPlugin from "chartjs-plugin-annotation"; import * as Comlink from "comlink"; +import PlexMono from "@lichtblick/suite-base/styles/assets/PlexMono.woff2"; + import { ChartRenderer } from "./ChartRenderer"; type InitArgs = { diff --git a/packages/suite-base/src/panels/Plot/OffscreenCanvasRenderer.ts b/packages/suite-base/src/panels/Plot/OffscreenCanvasRenderer.ts index a1665cd239..02232eeffa 100644 --- a/packages/suite-base/src/panels/Plot/OffscreenCanvasRenderer.ts +++ b/packages/suite-base/src/panels/Plot/OffscreenCanvasRenderer.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import type { Theme } from "@mui/material"; +import * as Comlink from "comlink"; + import { ComlinkWrap } from "@lichtblick/den/worker"; import { Immutable } from "@lichtblick/suite"; import { Bounds } from "@lichtblick/suite-base/types/Bounds"; -import type { Theme } from "@mui/material"; -import * as Comlink from "comlink"; import { ChartRenderer, Dataset, HoverElement, Scale, UpdateAction } from "./ChartRenderer"; import type { Service } from "./ChartRenderer.worker"; diff --git a/packages/suite-base/src/panels/Plot/Plot.tsx b/packages/suite-base/src/panels/Plot/Plot.tsx index 811a554d13..69484ceae7 100644 --- a/packages/suite-base/src/panels/Plot/Plot.tsx +++ b/packages/suite-base/src/panels/Plot/Plot.tsx @@ -1,7 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; +import { add as addTimes, fromSec, isTime, toSec } from "@foxglove/rostime"; +import { Button, Tooltip, Fade, buttonClasses, useTheme } from "@mui/material"; +import Hammer from "hammerjs"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useMountedState } from "react-use"; +import { makeStyles } from "tss-react/mui"; +import { v4 as uuidv4 } from "uuid"; + import { debouncePromise } from "@lichtblick/den/async"; import { filterMap } from "@lichtblick/den/collection"; import { Immutable } from "@lichtblick/suite"; @@ -38,16 +51,6 @@ import { SubscribePayload } from "@lichtblick/suite-base/players/types"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { PANEL_TITLE_CONFIG_KEY } from "@lichtblick/suite-base/util/layout"; import { getLineColor } from "@lichtblick/suite-base/util/plotColors"; -import { Button, Tooltip, Fade, buttonClasses, useTheme } from "@mui/material"; -import Hammer from "hammerjs"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { useMountedState } from "react-use"; -import { makeStyles } from "tss-react/mui"; -import { v4 as uuidv4 } from "uuid"; - -import { parseMessagePath } from "@foxglove/message-path"; -import { add as addTimes, fromSec, isTime, toSec } from "@foxglove/rostime"; import { OffscreenCanvasRenderer } from "./OffscreenCanvasRenderer"; import { PlotCoordinator } from "./PlotCoordinator"; diff --git a/packages/suite-base/src/panels/Plot/PlotCoordinator.ts b/packages/suite-base/src/panels/Plot/PlotCoordinator.ts index e7d602126c..5261f5d94f 100644 --- a/packages/suite-base/src/panels/Plot/PlotCoordinator.ts +++ b/packages/suite-base/src/panels/Plot/PlotCoordinator.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; +import { toSec, subtract as subtractTime } from "@foxglove/rostime"; +import EventEmitter from "eventemitter3"; +import * as _ from "lodash-es"; + import { debouncePromise } from "@lichtblick/den/async"; import { filterMap } from "@lichtblick/den/collection"; import { Immutable, Time } from "@lichtblick/suite"; @@ -14,11 +22,6 @@ import { MessageBlock, PlayerState } from "@lichtblick/suite-base/players/types" import { Bounds } from "@lichtblick/suite-base/types/Bounds"; import delay from "@lichtblick/suite-base/util/delay"; import { getContrastColor, getLineColor } from "@lichtblick/suite-base/util/plotColors"; -import EventEmitter from "eventemitter3"; -import * as _ from "lodash-es"; - -import { parseMessagePath } from "@foxglove/message-path"; -import { toSec, subtract as subtractTime } from "@foxglove/rostime"; import { Dataset, InteractionEvent, Scale, UpdateAction } from "./ChartRenderer"; import { OffscreenCanvasRenderer } from "./OffscreenCanvasRenderer"; diff --git a/packages/suite-base/src/panels/Plot/PlotLegend.tsx b/packages/suite-base/src/panels/Plot/PlotLegend.tsx index adf2258ccd..693eb77c18 100644 --- a/packages/suite-base/src/panels/Plot/PlotLegend.tsx +++ b/packages/suite-base/src/panels/Plot/PlotLegend.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,14 +13,15 @@ import { TextBulletListLtr20Filled, ArrowMinimize20Filled, } from "@fluentui/react-icons"; -import { Immutable } from "@lichtblick/suite"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { IconButton } from "@mui/material"; import * as _ from "lodash-es"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import tinycolor from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import { Immutable } from "@lichtblick/suite"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; + import type { PlotCoordinator } from "./PlotCoordinator"; import { PlotLegendRow, ROW_HEIGHT } from "./PlotLegendRow"; import { PlotPath, PlotConfig } from "./config"; diff --git a/packages/suite-base/src/panels/Plot/PlotLegendRow.tsx b/packages/suite-base/src/panels/Plot/PlotLegendRow.tsx index 08fc77bfbe..265b2a6aa4 100644 --- a/packages/suite-base/src/panels/Plot/PlotLegendRow.tsx +++ b/packages/suite-base/src/panels/Plot/PlotLegendRow.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -9,17 +12,17 @@ import { Square12Filled, Square12Regular, } from "@fluentui/react-icons"; -import { Immutable } from "@lichtblick/suite"; -import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; -import { useSelectedPanels } from "@lichtblick/suite-base/context/CurrentLayoutContext"; -import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; -import { getLineColor } from "@lichtblick/suite-base/util/plotColors"; +import { isTime, toSec } from "@foxglove/rostime"; import { ButtonBase, Checkbox, Tooltip, Typography, buttonBaseClasses } from "@mui/material"; import { MouseEventHandler } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles } from "tss-react/mui"; -import { isTime, toSec } from "@foxglove/rostime"; +import { Immutable } from "@lichtblick/suite"; +import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; +import { useSelectedPanels } from "@lichtblick/suite-base/context/CurrentLayoutContext"; +import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; +import { getLineColor } from "@lichtblick/suite-base/util/plotColors"; import { PlotPath, plotPathDisplayName } from "./config"; diff --git a/packages/suite-base/src/panels/Plot/VerticalBars.tsx b/packages/suite-base/src/panels/Plot/VerticalBars.tsx index 21b3a33781..aaae7f5bbe 100644 --- a/packages/suite-base/src/panels/Plot/VerticalBars.tsx +++ b/packages/suite-base/src/panels/Plot/VerticalBars.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useMessagePipelineSubscribe } from "@lichtblick/suite-base/components/MessagePipeline"; -import { useHoverValue } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; +import { toSec } from "@foxglove/rostime"; import { useCallback, useEffect, useLayoutEffect, useRef } from "react"; import { useLatest } from "react-use"; import { makeStyles } from "tss-react/mui"; -import { toSec } from "@foxglove/rostime"; +import { useMessagePipelineSubscribe } from "@lichtblick/suite-base/components/MessagePipeline"; +import { useHoverValue } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import type { Scale } from "./ChartRenderer"; import type { PlotCoordinator } from "./PlotCoordinator"; diff --git a/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.test.ts b/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.test.ts index 6348331673..275b323ba6 100644 --- a/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.test.ts +++ b/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.test.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; import * as _ from "lodash-es"; +import { MessageEvent } from "@lichtblick/suite"; + import { BlockTopicCursor } from "./BlockTopicCursor"; function groupByTopic(events: MessageEvent[]): Record { diff --git a/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.ts b/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.ts index b35cde2126..7f2d009bd2 100644 --- a/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.ts +++ b/packages/suite-base/src/panels/Plot/builders/BlockTopicCursor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.test.ts b/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.test.ts index edb1690f19..27c51fe5b8 100644 --- a/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.test.ts +++ b/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.test.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; + import { unwrap } from "@lichtblick/den/monads"; import { MessageBlock, @@ -10,8 +15,6 @@ import { PlayerStateActiveData, } from "@lichtblick/suite-base/players/types"; -import { parseMessagePath } from "@foxglove/message-path"; - import { CurrentCustomDatasetsBuilder } from "./CurrentCustomDatasetsBuilder"; import { SeriesConfigKey, SeriesItem } from "./IDatasetsBuilder"; import { PlotPath } from "../config"; diff --git a/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.ts b/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.ts index 4ad60a729c..2bccd7e540 100644 --- a/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.ts +++ b/packages/suite-base/src/panels/Plot/builders/CurrentCustomDatasetsBuilder.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; +import { ChartDataset } from "chart.js"; +import * as _ from "lodash-es"; + import { filterMap } from "@lichtblick/den/collection"; import { Immutable, Time, MessageEvent } from "@lichtblick/suite"; import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; import { PlayerState } from "@lichtblick/suite-base/players/types"; -import { ChartDataset } from "chart.js"; -import * as _ from "lodash-es"; - -import { MessagePath } from "@foxglove/message-path"; import { CsvDataset, diff --git a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.test.ts b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.test.ts index b6fe376353..87198ea985 100644 --- a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.test.ts +++ b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.test.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; +import * as _ from "lodash-es"; + import { unwrap } from "@lichtblick/den/monads"; import { makeComlinkWorkerMock } from "@lichtblick/den/testing"; import { MessageEvent } from "@lichtblick/suite"; @@ -11,9 +17,6 @@ import { PlayerState, PlayerStateActiveData, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; - -import { parseMessagePath } from "@foxglove/message-path"; import { CustomDatasetsBuilder } from "./CustomDatasetsBuilder"; import { CustomDatasetsBuilderImpl } from "./CustomDatasetsBuilderImpl"; diff --git a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.ts b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.ts index 1f96d3b2ac..e531acd36f 100644 --- a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.ts +++ b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilder.ts @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; +import * as Comlink from "comlink"; + import { ComlinkWrap } from "@lichtblick/den/worker"; import { Immutable, MessageEvent } from "@lichtblick/suite"; import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; import { Bounds1D } from "@lichtblick/suite-base/components/TimeBasedChart/types"; import { PlayerState } from "@lichtblick/suite-base/players/types"; import { extendBounds1D, unionBounds1D } from "@lichtblick/suite-base/types/Bounds"; -import * as Comlink from "comlink"; - -import { MessagePath } from "@foxglove/message-path"; import { BlockTopicCursor } from "./BlockTopicCursor"; import { diff --git a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.ts b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.ts index 40c3e331bc..e1da69987d 100644 --- a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.ts +++ b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { compare } from "@foxglove/rostime"; + import { Immutable, Time } from "@lichtblick/suite"; import { downsampleScatter } from "@lichtblick/suite-base/components/TimeBasedChart/downsample"; import { Bounds1D } from "@lichtblick/suite-base/components/TimeBasedChart/types"; import { extendBounds1D } from "@lichtblick/suite-base/types/Bounds"; -import { compare } from "@foxglove/rostime"; - import { CsvDataset, GetViewportDatasetsResult, diff --git a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.worker.ts b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.worker.ts index 6fd83ba204..c6742eb75a 100644 --- a/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.worker.ts +++ b/packages/suite-base/src/panels/Plot/builders/CustomDatasetsBuilderImpl.worker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/builders/IDatasetsBuilder.ts b/packages/suite-base/src/panels/Plot/builders/IDatasetsBuilder.ts index 461a320ae7..6d9218edd3 100644 --- a/packages/suite-base/src/panels/Plot/builders/IDatasetsBuilder.ts +++ b/packages/suite-base/src/panels/Plot/builders/IDatasetsBuilder.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; +import { Opaque } from "ts-essentials"; + import type { Immutable, Time } from "@lichtblick/suite"; import type { Bounds1D } from "@lichtblick/suite-base/components/TimeBasedChart/types"; import type { MessageBlock, PlayerState } from "@lichtblick/suite-base/players/types"; import { TimestampMethod } from "@lichtblick/suite-base/util/time"; -import { Opaque } from "ts-essentials"; - -import { MessagePath } from "@foxglove/message-path"; import type { Dataset } from "../ChartRenderer"; import { OriginalValue } from "../datum"; diff --git a/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.test.ts b/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.test.ts index 1969f94f98..c841ef9c9e 100644 --- a/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.test.ts +++ b/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.test.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; + import { unwrap } from "@lichtblick/den/monads"; import { MessageBlock, @@ -10,8 +15,6 @@ import { PlayerStateActiveData, } from "@lichtblick/suite-base/players/types"; -import { parseMessagePath } from "@foxglove/message-path"; - import { SeriesConfigKey, SeriesItem } from "./IDatasetsBuilder"; import { IndexDatasetsBuilder } from "./IndexDatasetsBuilder"; import { PlotPath } from "../config"; diff --git a/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.ts b/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.ts index ac6743ec61..43dbb27d58 100644 --- a/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.ts +++ b/packages/suite-base/src/panels/Plot/builders/IndexDatasetsBuilder.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; +import { ChartDataset } from "chart.js"; + import { filterMap } from "@lichtblick/den/collection"; import { Immutable, Time, MessageEvent } from "@lichtblick/suite"; import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; import { Bounds1D } from "@lichtblick/suite-base/components/TimeBasedChart/types"; import { PlayerState } from "@lichtblick/suite-base/players/types"; -import { ChartDataset } from "chart.js"; - -import { MessagePath } from "@foxglove/message-path"; import { CsvDataset, diff --git a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.test.ts b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.test.ts index 6f2a07d334..108cc43ed7 100644 --- a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.test.ts +++ b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.test.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { parseMessagePath } from "@foxglove/message-path"; +import * as _ from "lodash-es"; + import { unwrap } from "@lichtblick/den/monads"; import { makeComlinkWorkerMock } from "@lichtblick/den/testing"; import { MessageEvent } from "@lichtblick/suite"; @@ -11,9 +17,6 @@ import { PlayerState, PlayerStateActiveData, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; - -import { parseMessagePath } from "@foxglove/message-path"; import { SeriesConfigKey, SeriesItem } from "./IDatasetsBuilder"; import { TimestampDatasetsBuilder } from "./TimestampDatasetsBuilder"; diff --git a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.ts b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.ts index 89818d5109..33fbdb5016 100644 --- a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.ts +++ b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilder.ts @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MessagePath } from "@foxglove/message-path"; +import { toSec, subtract as subtractTime } from "@foxglove/rostime"; +import * as Comlink from "comlink"; + import { ComlinkWrap } from "@lichtblick/den/worker"; import { Immutable, MessageEvent, Time } from "@lichtblick/suite"; import { simpleGetMessagePathDataItems } from "@lichtblick/suite-base/components/MessagePathSyntax/simpleGetMessagePathDataItems"; import { MessageBlock, PlayerState } from "@lichtblick/suite-base/players/types"; import { TimestampMethod, getTimestampForMessage } from "@lichtblick/suite-base/util/time"; -import * as Comlink from "comlink"; - -import { MessagePath } from "@foxglove/message-path"; -import { toSec, subtract as subtractTime } from "@foxglove/rostime"; import { BlockTopicCursor } from "./BlockTopicCursor"; import { diff --git a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts index 500d72f88e..d6b6169cd8 100644 --- a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts +++ b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.worker.ts b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.worker.ts index d5db89f2a3..1c4fb5ecbe 100644 --- a/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.worker.ts +++ b/packages/suite-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.worker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/config.test.ts b/packages/suite-base/src/panels/Plot/config.test.ts index 08c88596f4..af14fbed35 100644 --- a/packages/suite-base/src/panels/Plot/config.test.ts +++ b/packages/suite-base/src/panels/Plot/config.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/config.ts b/packages/suite-base/src/panels/Plot/config.ts index 6c61694f96..5c030569aa 100644 --- a/packages/suite-base/src/panels/Plot/config.ts +++ b/packages/suite-base/src/panels/Plot/config.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; + import { Immutable } from "@lichtblick/suite"; import { MessagePathDataItem } from "@lichtblick/suite-base/components/MessagePathSyntax/useCachedGetMessagePathDataItems"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { PANEL_TITLE_CONFIG_KEY } from "@lichtblick/suite-base/util/layout"; import { TimestampMethod } from "@lichtblick/suite-base/util/time"; -import { Time } from "@foxglove/rostime"; - export type Messages = Record; export type BasePlotPath = { diff --git a/packages/suite-base/src/panels/Plot/csv.test.ts b/packages/suite-base/src/panels/Plot/csv.test.ts index 3579e3e1fd..7fba091c90 100644 --- a/packages/suite-base/src/panels/Plot/csv.test.ts +++ b/packages/suite-base/src/panels/Plot/csv.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/csv.ts b/packages/suite-base/src/panels/Plot/csv.ts index dff260564d..f4d4b3e8ef 100644 --- a/packages/suite-base/src/panels/Plot/csv.ts +++ b/packages/suite-base/src/panels/Plot/csv.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/datum.ts b/packages/suite-base/src/panels/Plot/datum.ts index 2b451124d5..cf38b243f3 100644 --- a/packages/suite-base/src/panels/Plot/datum.ts +++ b/packages/suite-base/src/panels/Plot/datum.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Time } from "@lichtblick/suite"; +import { isTime, toSec } from "@foxglove/rostime"; import { ScatterDataPoint } from "chart.js"; -import { isTime, toSec } from "@foxglove/rostime"; +import { Time } from "@lichtblick/suite"; // In addition to the base datum, we also add receiveTime and optionally header stamp to our datums // These are used in the csv export. diff --git a/packages/suite-base/src/panels/Plot/index.stories.tsx b/packages/suite-base/src/panels/Plot/index.stories.tsx index d8830bce0a..82d3bc5b47 100644 --- a/packages/suite-base/src/panels/Plot/index.stories.tsx +++ b/packages/suite-base/src/panels/Plot/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import PanelSetup, { Fixture, triggerWheel } from "@lichtblick/suite-base/stories/PanelSetup"; -import delay from "@lichtblick/suite-base/util/delay"; import { StoryObj } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; import { produce } from "immer"; import { useEffect, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import PanelSetup, { Fixture, triggerWheel } from "@lichtblick/suite-base/stories/PanelSetup"; +import delay from "@lichtblick/suite-base/util/delay"; + import { PlotConfig } from "./config"; import Plot from "./index"; import { fixture } from "./storyFixtures"; diff --git a/packages/suite-base/src/panels/Plot/index.tsx b/packages/suite-base/src/panels/Plot/index.tsx index e045005532..e157da1ea6 100644 --- a/packages/suite-base/src/panels/Plot/index.tsx +++ b/packages/suite-base/src/panels/Plot/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/mathFunctions.ts b/packages/suite-base/src/panels/Plot/mathFunctions.ts index fe86d53353..343582b6db 100644 --- a/packages/suite-base/src/panels/Plot/mathFunctions.ts +++ b/packages/suite-base/src/panels/Plot/mathFunctions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/openSiblingPlotPanel.ts b/packages/suite-base/src/panels/Plot/openSiblingPlotPanel.ts index e24a025d17..ec9be09cb3 100644 --- a/packages/suite-base/src/panels/Plot/openSiblingPlotPanel.ts +++ b/packages/suite-base/src/panels/Plot/openSiblingPlotPanel.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { OpenSiblingPanel, PanelConfig } from "@lichtblick/suite-base/types/panels"; import * as _ from "lodash-es"; +import type { OpenSiblingPanel, PanelConfig } from "@lichtblick/suite-base/types/panels"; + import type { PlotConfig } from "./config"; export function openSiblingPlotPanel(openSiblingPanel: OpenSiblingPanel, topicName: string): void { diff --git a/packages/suite-base/src/panels/Plot/plotableRosTypes.ts b/packages/suite-base/src/panels/Plot/plotableRosTypes.ts index 620f6f0dc7..4b70b950f9 100644 --- a/packages/suite-base/src/panels/Plot/plotableRosTypes.ts +++ b/packages/suite-base/src/panels/Plot/plotableRosTypes.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/settings.ts b/packages/suite-base/src/panels/Plot/settings.ts index f7100404c0..a75c7380af 100644 --- a/packages/suite-base/src/panels/Plot/settings.ts +++ b/packages/suite-base/src/panels/Plot/settings.ts @@ -1,11 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; -import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { lineColors } from "@lichtblick/suite-base/util/plotColors"; import { TFunction } from "i18next"; import { produce } from "immer"; import * as _ from "lodash-es"; @@ -13,6 +12,11 @@ import memoizeWeak from "memoize-weak"; import { useCallback, useEffect } from "react"; import { useTranslation } from "react-i18next"; +import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; +import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; +import { lineColors } from "@lichtblick/suite-base/util/plotColors"; + import { PlotPath, PlotConfig, plotPathDisplayName } from "./config"; import { plotableRosTypes } from "./plotableRosTypes"; @@ -23,7 +27,7 @@ export const DEFAULT_PATH: PlotPath = Object.freeze({ }); const makeSeriesNode = memoizeWeak( - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters (path: PlotPath, index: number, canDelete: boolean, t: TFunction<"plot">): SettingsTreeNode => { return { actions: canDelete diff --git a/packages/suite-base/src/panels/Plot/storyFixtures.ts b/packages/suite-base/src/panels/Plot/storyFixtures.ts index 29d340d3fc..3732581d82 100644 --- a/packages/suite-base/src/panels/Plot/storyFixtures.ts +++ b/packages/suite-base/src/panels/Plot/storyFixtures.ts @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec, toSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; + import { BlockCache, MessageBlock, MessageEvent } from "@lichtblick/suite-base/players/types"; import { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import * as _ from "lodash-es"; - -import { fromSec, toSec } from "@foxglove/rostime"; const locationMessages = [ { diff --git a/packages/suite-base/src/panels/Plot/subscription.test.ts b/packages/suite-base/src/panels/Plot/subscription.test.ts index 838be4774b..f164837f4e 100644 --- a/packages/suite-base/src/panels/Plot/subscription.test.ts +++ b/packages/suite-base/src/panels/Plot/subscription.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Plot/subscription.ts b/packages/suite-base/src/panels/Plot/subscription.ts index 4f72d2c415..f3932fba10 100644 --- a/packages/suite-base/src/panels/Plot/subscription.ts +++ b/packages/suite-base/src/panels/Plot/subscription.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import type { MessagePathPart, MessagePath } from "@foxglove/message-path"; + import type { Immutable } from "@lichtblick/suite"; import type { SubscribePayload, SubscriptionPreloadType, } from "@lichtblick/suite-base/players/types"; -import type { MessagePathPart, MessagePath } from "@foxglove/message-path"; - const typeIsName = (part: Immutable) => part.type === "name"; export function pathToSubscribePayload( diff --git a/packages/suite-base/src/panels/Publish/buildSampleMessage.test.ts b/packages/suite-base/src/panels/Publish/buildSampleMessage.test.ts index af6b609a0c..093db12a88 100644 --- a/packages/suite-base/src/panels/Publish/buildSampleMessage.test.ts +++ b/packages/suite-base/src/panels/Publish/buildSampleMessage.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Publish/buildSampleMessage.ts b/packages/suite-base/src/panels/Publish/buildSampleMessage.ts index 74a7be2a7b..f170073c76 100644 --- a/packages/suite-base/src/panels/Publish/buildSampleMessage.ts +++ b/packages/suite-base/src/panels/Publish/buildSampleMessage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Publish/index.stories.tsx b/packages/suite-base/src/panels/Publish/index.stories.tsx index ab631676b2..c50bd9b9e0 100644 --- a/packages/suite-base/src/panels/Publish/index.stories.tsx +++ b/packages/suite-base/src/panels/Publish/index.stories.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Publish from "@lichtblick/suite-base/panels/Publish"; -import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { action } from "@storybook/addon-actions"; import { expect } from "@storybook/jest"; import { Meta, StoryObj } from "@storybook/react"; import { userEvent, within } from "@storybook/testing-library"; +import Publish from "@lichtblick/suite-base/panels/Publish"; +import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; + import { PublishConfig } from "./types"; const getFixture = ({ allowPublish }: { allowPublish: boolean }): Fixture => { diff --git a/packages/suite-base/src/panels/Publish/index.tsx b/packages/suite-base/src/panels/Publish/index.tsx index 7702db915b..722c7a6a53 100644 --- a/packages/suite-base/src/panels/Publish/index.tsx +++ b/packages/suite-base/src/panels/Publish/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { MessageDefinition } from "@foxglove/message-definition"; +import CommonRosTypes from "@foxglove/rosmsg-msgs-common"; +import { Button, inputBaseClasses, TextField, Tooltip, Typography } from "@mui/material"; +import { useEffect, useMemo } from "react"; +import { makeStyles } from "tss-react/mui"; +import { useDebounce } from "use-debounce"; + import { Immutable } from "@lichtblick/suite"; import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; import { @@ -25,13 +35,6 @@ import usePublisher from "@lichtblick/suite-base/hooks/usePublisher"; import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; import { useDefaultPanelTitle } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { Button, inputBaseClasses, TextField, Tooltip, Typography } from "@mui/material"; -import { useEffect, useMemo } from "react"; -import { makeStyles } from "tss-react/mui"; -import { useDebounce } from "use-debounce"; - -import { MessageDefinition } from "@foxglove/message-definition"; -import CommonRosTypes from "@foxglove/rosmsg-msgs-common"; import { defaultConfig, usePublishPanelSettings } from "./settings"; import { PublishConfig } from "./types"; diff --git a/packages/suite-base/src/panels/Publish/settings.ts b/packages/suite-base/src/panels/Publish/settings.ts index 56c438e16d..64e49d1b69 100644 --- a/packages/suite-base/src/panels/Publish/settings.ts +++ b/packages/suite-base/src/panels/Publish/settings.ts @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { produce } from "immer"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useMemo } from "react"; + import { Immutable, SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; import buildSampleMessage from "@lichtblick/suite-base/panels/Publish/buildSampleMessage"; import { Topic } from "@lichtblick/suite-base/players/types"; import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { produce } from "immer"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useMemo } from "react"; import { PublishConfig } from "./types"; diff --git a/packages/suite-base/src/panels/Publish/types.ts b/packages/suite-base/src/panels/Publish/types.ts index de85b5f9bb..0c821d65cb 100644 --- a/packages/suite-base/src/panels/Publish/types.ts +++ b/packages/suite-base/src/panels/Publish/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/DiffSpan.tsx b/packages/suite-base/src/panels/RawMessages/DiffSpan.tsx index 5eb3d15805..f8c28eabab 100644 --- a/packages/suite-base/src/panels/RawMessages/DiffSpan.tsx +++ b/packages/suite-base/src/panels/RawMessages/DiffSpan.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/DiffStats.tsx b/packages/suite-base/src/panels/RawMessages/DiffStats.tsx index ccab480d53..9e31c59bda 100644 --- a/packages/suite-base/src/panels/RawMessages/DiffStats.tsx +++ b/packages/suite-base/src/panels/RawMessages/DiffStats.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { diffLabels, DiffObject } from "@lichtblick/suite-base/panels/RawMessages/getDiff"; -import { getChangeCounts } from "@lichtblick/suite-base/panels/RawMessages/utils"; import { Typography } from "@mui/material"; import { ReactNode } from "react"; import { makeStyles } from "tss-react/mui"; +import { diffLabels, DiffObject } from "@lichtblick/suite-base/panels/RawMessages/getDiff"; +import { getChangeCounts } from "@lichtblick/suite-base/panels/RawMessages/utils"; + const useStyles = makeStyles()((theme) => ({ diff: { float: "right", diff --git a/packages/suite-base/src/panels/RawMessages/HighlightedValue.tsx b/packages/suite-base/src/panels/RawMessages/HighlightedValue.tsx index f7fb8b7772..37be62ea29 100644 --- a/packages/suite-base/src/panels/RawMessages/HighlightedValue.tsx +++ b/packages/suite-base/src/panels/RawMessages/HighlightedValue.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/MaybeCollapsedValue.tsx b/packages/suite-base/src/panels/RawMessages/MaybeCollapsedValue.tsx index 745bb7b9f3..c06ce206ba 100644 --- a/packages/suite-base/src/panels/RawMessages/MaybeCollapsedValue.tsx +++ b/packages/suite-base/src/panels/RawMessages/MaybeCollapsedValue.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/Metadata.tsx b/packages/suite-base/src/panels/RawMessages/Metadata.tsx index 0bf5255453..7ab5cef5c7 100644 --- a/packages/suite-base/src/panels/RawMessages/Metadata.tsx +++ b/packages/suite-base/src/panels/RawMessages/Metadata.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,15 +14,16 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import CopyButton from "@lichtblick/suite-base/components/CopyButton"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { MessageEvent } from "@lichtblick/suite-base/players/types"; -import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; import { Link, Typography } from "@mui/material"; import { useCallback } from "react"; import { useLatest } from "react-use"; import { makeStyles } from "tss-react/mui"; +import CopyButton from "@lichtblick/suite-base/components/CopyButton"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { MessageEvent } from "@lichtblick/suite-base/players/types"; +import { formatTimeRaw } from "@lichtblick/suite-base/util/time"; + import { copyMessageReplacer } from "./copyMessageReplacer"; import { getMessageDocumentationLink } from "./utils"; diff --git a/packages/suite-base/src/panels/RawMessages/Toolbar.tsx b/packages/suite-base/src/panels/RawMessages/Toolbar.tsx index f9fc982793..917e6580f9 100644 --- a/packages/suite-base/src/panels/RawMessages/Toolbar.tsx +++ b/packages/suite-base/src/panels/RawMessages/Toolbar.tsx @@ -1,12 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Topic } from "@lichtblick/suite"; -import MessagePathInput from "@lichtblick/suite-base/components/MessagePathSyntax/MessagePathInput"; -import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import DiffIcon from "@mui/icons-material/Difference"; import DiffOutlinedIcon from "@mui/icons-material/DifferenceOutlined"; import UnfoldLessIcon from "@mui/icons-material/UnfoldLess"; @@ -14,6 +12,12 @@ import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore"; import { IconButton, MenuItem, Select, SelectChangeEvent } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import { Topic } from "@lichtblick/suite"; +import MessagePathInput from "@lichtblick/suite-base/components/MessagePathSyntax/MessagePathInput"; +import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; + import { Constants, RawMessagesPanelConfig } from "./types"; type Props = { diff --git a/packages/suite-base/src/panels/RawMessages/Value.tsx b/packages/suite-base/src/panels/RawMessages/Value.tsx index 06d766dba8..ca468ecae3 100644 --- a/packages/suite-base/src/panels/RawMessages/Value.tsx +++ b/packages/suite-base/src/panels/RawMessages/Value.tsx @@ -1,17 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import HoverableIconButton from "@lichtblick/suite-base/components/HoverableIconButton"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { openSiblingPlotPanel } from "@lichtblick/suite-base/panels/Plot/openSiblingPlotPanel"; -import { plotableRosTypes } from "@lichtblick/suite-base/panels/Plot/plotableRosTypes"; -import { - openSiblingStateTransitionsPanel, - transitionableRosTypes, -} from "@lichtblick/suite-base/panels/StateTransitions/openSiblingStateTransitionsPanel"; -import { OpenSiblingPanel } from "@lichtblick/suite-base/types/panels"; -import clipboard from "@lichtblick/suite-base/util/clipboard"; import CheckIcon from "@mui/icons-material/Check"; import CopyAllIcon from "@mui/icons-material/CopyAll"; import ErrorIcon from "@mui/icons-material/Error"; @@ -23,6 +16,17 @@ import { IconButtonProps, Tooltip, TooltipProps } from "@mui/material"; import { useCallback, useMemo, useState, useRef, useEffect } from "react"; import { withStyles, makeStyles } from "tss-react/mui"; +import HoverableIconButton from "@lichtblick/suite-base/components/HoverableIconButton"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { openSiblingPlotPanel } from "@lichtblick/suite-base/panels/Plot/openSiblingPlotPanel"; +import { plotableRosTypes } from "@lichtblick/suite-base/panels/Plot/plotableRosTypes"; +import { + openSiblingStateTransitionsPanel, + transitionableRosTypes, +} from "@lichtblick/suite-base/panels/StateTransitions/openSiblingStateTransitionsPanel"; +import { OpenSiblingPanel } from "@lichtblick/suite-base/types/panels"; +import clipboard from "@lichtblick/suite-base/util/clipboard"; + import HighlightedValue from "./HighlightedValue"; import { copyMessageReplacer } from "./copyMessageReplacer"; import { ValueAction } from "./getValueActionForValue"; diff --git a/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.test.ts b/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.test.ts index 9412172219..53d5587509 100644 --- a/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.test.ts +++ b/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.ts b/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.ts index b4ef3e3ed0..c737068a76 100644 --- a/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.ts +++ b/packages/suite-base/src/panels/RawMessages/copyMessageReplacer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/fixture.ts b/packages/suite-base/src/panels/RawMessages/fixture.ts index feb5c4ad74..14954eeede 100644 --- a/packages/suite-base/src/panels/RawMessages/fixture.ts +++ b/packages/suite-base/src/panels/RawMessages/fixture.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/getDiff.test.ts b/packages/suite-base/src/panels/RawMessages/getDiff.test.ts index f47ccdc512..9c65178313 100644 --- a/packages/suite-base/src/panels/RawMessages/getDiff.test.ts +++ b/packages/suite-base/src/panels/RawMessages/getDiff.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/getDiff.ts b/packages/suite-base/src/panels/RawMessages/getDiff.ts index a47f4cf9cf..7aae51d97e 100644 --- a/packages/suite-base/src/panels/RawMessages/getDiff.ts +++ b/packages/suite-base/src/panels/RawMessages/getDiff.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,9 +13,10 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; import * as _ from "lodash-es"; +import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; + export const diffArrow = "->"; export const diffLabels = { ADDED: { diff --git a/packages/suite-base/src/panels/RawMessages/getValueActionForValue.test.ts b/packages/suite-base/src/panels/RawMessages/getValueActionForValue.test.ts index e0a2c16a37..9a48ebf5fa 100644 --- a/packages/suite-base/src/panels/RawMessages/getValueActionForValue.test.ts +++ b/packages/suite-base/src/panels/RawMessages/getValueActionForValue.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/getValueActionForValue.ts b/packages/suite-base/src/panels/RawMessages/getValueActionForValue.ts index c4138fd949..f9ba551753 100644 --- a/packages/suite-base/src/panels/RawMessages/getValueActionForValue.ts +++ b/packages/suite-base/src/panels/RawMessages/getValueActionForValue.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; - import { MessagePathStructureItem, PrimitiveType } from "@foxglove/message-path"; +import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; + export type ValueAction = { singleSlicePath: string; // Path that will only return one value per unit of time (for line charts). multiSlicePath: string; // Path that might return multiple values per unit of time (for scatter plots). diff --git a/packages/suite-base/src/panels/RawMessages/index.stories.tsx b/packages/suite-base/src/panels/RawMessages/index.stories.tsx index de5fc100e1..18f80f8090 100644 --- a/packages/suite-base/src/panels/RawMessages/index.stories.tsx +++ b/packages/suite-base/src/panels/RawMessages/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; + import RawMessages from "@lichtblick/suite-base/panels/RawMessages"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { enumAdvancedFixture, diff --git a/packages/suite-base/src/panels/RawMessages/index.tsx b/packages/suite-base/src/panels/RawMessages/index.tsx index 16366d8877..5f47a1da47 100644 --- a/packages/suite-base/src/panels/RawMessages/index.tsx +++ b/packages/suite-base/src/panels/RawMessages/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { parseMessagePath, MessagePathStructureItem, MessagePath } from "@foxglove/message-path"; +import { Checkbox, FormControlLabel, Typography, useTheme } from "@mui/material"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import ReactHoverObserver from "react-hover-observer"; +import Tree from "react-json-tree"; +import { makeStyles } from "tss-react/mui"; + import { Immutable, SettingsTreeAction } from "@lichtblick/suite"; import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; import EmptyState from "@lichtblick/suite-base/components/EmptyState"; @@ -35,14 +46,6 @@ import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/Pan import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { enumValuesByDatatypeAndField } from "@lichtblick/suite-base/util/enums"; import { useJsonTreeTheme } from "@lichtblick/suite-base/util/globalConstants"; -import { Checkbox, FormControlLabel, Typography, useTheme } from "@mui/material"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import ReactHoverObserver from "react-hover-observer"; -import Tree from "react-json-tree"; -import { makeStyles } from "tss-react/mui"; - -import { parseMessagePath, MessagePathStructureItem, MessagePath } from "@foxglove/message-path"; import { DiffSpan } from "./DiffSpan"; import DiffStats from "./DiffStats"; diff --git a/packages/suite-base/src/panels/RawMessages/types.ts b/packages/suite-base/src/panels/RawMessages/types.ts index 95944c7138..686337afa1 100644 --- a/packages/suite-base/src/panels/RawMessages/types.ts +++ b/packages/suite-base/src/panels/RawMessages/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/utils.test.ts b/packages/suite-base/src/panels/RawMessages/utils.test.ts index 4436745d9a..08d32d9c9e 100644 --- a/packages/suite-base/src/panels/RawMessages/utils.test.ts +++ b/packages/suite-base/src/panels/RawMessages/utils.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/RawMessages/utils.ts b/packages/suite-base/src/panels/RawMessages/utils.ts index 14ea28059b..02d3043ddf 100644 --- a/packages/suite-base/src/panels/RawMessages/utils.ts +++ b/packages/suite-base/src/panels/RawMessages/utils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { diffLabels, DiffObject } from "@lichtblick/suite-base/panels/RawMessages/getDiff"; -import * as _ from "lodash-es"; - import { ros1 } from "@foxglove/rosmsg-msgs-common"; import { foxgloveMessageSchemas } from "@foxglove/schemas/internal"; +import * as _ from "lodash-es"; + +import { diffLabels, DiffObject } from "@lichtblick/suite-base/panels/RawMessages/getDiff"; import type { NodeExpansion } from "./types"; import { NodeState } from "./types"; diff --git a/packages/suite-base/src/panels/StateTransitions/PathLegend.tsx b/packages/suite-base/src/panels/StateTransitions/PathLegend.tsx index d28aee5a57..654ec65611 100644 --- a/packages/suite-base/src/panels/StateTransitions/PathLegend.tsx +++ b/packages/suite-base/src/panels/StateTransitions/PathLegend.tsx @@ -1,8 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { Add16Regular, Dismiss12Regular } from "@fluentui/react-icons"; +import { Button, ButtonGroup, Stack, buttonClasses } from "@mui/material"; +import { MouseEvent, useCallback } from "react"; +import tinycolor from "tinycolor2"; +import { makeStyles } from "tss-react/mui"; + import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; import { useSelectedPanels } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { useWorkspaceActions } from "@lichtblick/suite-base/context/Workspace/useWorkspaceActions"; @@ -13,10 +21,6 @@ import { StateTransitionPath, } from "@lichtblick/suite-base/panels/StateTransitions/types"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { Button, ButtonGroup, Stack, buttonClasses } from "@mui/material"; -import { MouseEvent, useCallback } from "react"; -import tinycolor from "tinycolor2"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ chartOverlay: { diff --git a/packages/suite-base/src/panels/StateTransitions/index.stories.tsx b/packages/suite-base/src/panels/StateTransitions/index.stories.tsx index 08b8b8d625..22bec1ef79 100644 --- a/packages/suite-base/src/panels/StateTransitions/index.stories.tsx +++ b/packages/suite-base/src/panels/StateTransitions/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; +import { produce } from "immer"; +import { useCallback } from "react"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { BlockCache } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; import { expandedLineColors } from "@lichtblick/suite-base/util/plotColors"; -import { StoryObj } from "@storybook/react"; -import { produce } from "immer"; -import { useCallback } from "react"; import StateTransitions from "./index"; diff --git a/packages/suite-base/src/panels/StateTransitions/index.tsx b/packages/suite-base/src/panels/StateTransitions/index.tsx index 74f3a5064e..8ff956f2d1 100644 --- a/packages/suite-base/src/panels/StateTransitions/index.tsx +++ b/packages/suite-base/src/panels/StateTransitions/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { add as addTimes, fromSec, subtract as subtractTimes, toSec } from "@foxglove/rostime"; +import { fontMonospace } from "@foxglove/theme"; +import { ChartOptions, ScaleOptions } from "chart.js"; +import * as _ from "lodash-es"; +import * as R from "ramda"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { useResizeDetector } from "react-resize-detector"; +import { makeStyles } from "tss-react/mui"; + import { filterMap } from "@lichtblick/den/collection"; import { Immutable } from "@lichtblick/suite"; import { useBlocksSubscriptions } from "@lichtblick/suite-base/PanelAPI"; @@ -34,18 +46,9 @@ import { ChartDatasets } from "@lichtblick/suite-base/components/TimeBasedChart/ import { PathLegend } from "@lichtblick/suite-base/panels/StateTransitions/PathLegend"; import { subscribePayloadFromMessagePath } from "@lichtblick/suite-base/players/subscribePayloadFromMessagePath"; import { SubscribePayload } from "@lichtblick/suite-base/players/types"; +import { OnClickArg as OnChartClickArgs } from "@lichtblick/suite-base/src/components/Chart"; import { Bounds } from "@lichtblick/suite-base/types/Bounds"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { ChartOptions, ScaleOptions } from "chart.js"; -import * as _ from "lodash-es"; -import * as R from "ramda"; -import { useCallback, useEffect, useMemo, useState } from "react"; -import { useResizeDetector } from "react-resize-detector"; -import { makeStyles } from "tss-react/mui"; - -import { add as addTimes, fromSec, subtract as subtractTimes, toSec } from "@foxglove/rostime"; -import { fontMonospace } from "@foxglove/theme"; -import { OnClickArg as OnChartClickArgs } from "@lichtblick/suite-base/src/components/Chart"; import { messagesToDataset } from "./messagesToDataset"; import { PathState, useStateTransitionsPanelSettings } from "./settings"; diff --git a/packages/suite-base/src/panels/StateTransitions/messagesToDataset.ts b/packages/suite-base/src/panels/StateTransitions/messagesToDataset.ts index f86f4deb37..97dbabc4de 100644 --- a/packages/suite-base/src/panels/StateTransitions/messagesToDataset.ts +++ b/packages/suite-base/src/panels/StateTransitions/messagesToDataset.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, subtract as subtractTimes, toSec } from "@foxglove/rostime"; +import stringHash from "string-hash"; + import { MessageAndData } from "@lichtblick/suite-base/components/MessagePathSyntax/useCachedGetMessagePathDataItems"; import { ChartDataset } from "@lichtblick/suite-base/components/TimeBasedChart/types"; import { expandedLineColors } from "@lichtblick/suite-base/util/plotColors"; import { getTimestampForMessageEvent } from "@lichtblick/suite-base/util/time"; import { grey } from "@lichtblick/suite-base/util/toolsColorScheme"; -import stringHash from "string-hash"; - -import { Time, subtract as subtractTimes, toSec } from "@foxglove/rostime"; import positiveModulo from "./positiveModulo"; import { StateTransitionPath } from "./types"; diff --git a/packages/suite-base/src/panels/StateTransitions/openSiblingStateTransitionsPanel.ts b/packages/suite-base/src/panels/StateTransitions/openSiblingStateTransitionsPanel.ts index c81c3cc695..b6cb38d1e0 100644 --- a/packages/suite-base/src/panels/StateTransitions/openSiblingStateTransitionsPanel.ts +++ b/packages/suite-base/src/panels/StateTransitions/openSiblingStateTransitionsPanel.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; + import { StateTransitionConfig } from "@lichtblick/suite-base/panels/StateTransitions/types"; import { OpenSiblingPanel, PanelConfig } from "@lichtblick/suite-base/types/panels"; -import * as _ from "lodash-es"; export const transitionableRosTypes = [ "bool", diff --git a/packages/suite-base/src/panels/StateTransitions/positiveModulo.test.ts b/packages/suite-base/src/panels/StateTransitions/positiveModulo.test.ts index d6a0ce5cad..c51b55f05e 100644 --- a/packages/suite-base/src/panels/StateTransitions/positiveModulo.test.ts +++ b/packages/suite-base/src/panels/StateTransitions/positiveModulo.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/StateTransitions/positiveModulo.ts b/packages/suite-base/src/panels/StateTransitions/positiveModulo.ts index 5df0da7909..5f35a10043 100644 --- a/packages/suite-base/src/panels/StateTransitions/positiveModulo.ts +++ b/packages/suite-base/src/panels/StateTransitions/positiveModulo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/StateTransitions/settings.ts b/packages/suite-base/src/panels/StateTransitions/settings.ts index 3d08c296ad..8bc0ac9fcf 100644 --- a/packages/suite-base/src/panels/StateTransitions/settings.ts +++ b/packages/suite-base/src/panels/StateTransitions/settings.ts @@ -1,11 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; -import { plotableRosTypes } from "@lichtblick/suite-base/panels/Plot/plotableRosTypes"; -import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { TFunction } from "i18next"; import { produce } from "immer"; import * as _ from "lodash-es"; @@ -13,6 +12,11 @@ import memoizeWeak from "memoize-weak"; import { useCallback, useEffect } from "react"; import { useTranslation } from "react-i18next"; +import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; +import { plotableRosTypes } from "@lichtblick/suite-base/panels/Plot/plotableRosTypes"; +import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; + import { DEFAULT_PATH, stateTransitionPathDisplayName } from "./shared"; import { StateTransitionConfig, StateTransitionPath } from "./types"; diff --git a/packages/suite-base/src/panels/StateTransitions/shared.ts b/packages/suite-base/src/panels/StateTransitions/shared.ts index e797e14d23..ad01b9bda0 100644 --- a/packages/suite-base/src/panels/StateTransitions/shared.ts +++ b/packages/suite-base/src/panels/StateTransitions/shared.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/StateTransitions/types.ts b/packages/suite-base/src/panels/StateTransitions/types.ts index 86852bbbd5..676bd99793 100644 --- a/packages/suite-base/src/panels/StateTransitions/types.ts +++ b/packages/suite-base/src/panels/StateTransitions/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Tab/DraggableToolbarTab.tsx b/packages/suite-base/src/panels/Tab/DraggableToolbarTab.tsx index 793d5e08c4..15b05cae65 100644 --- a/packages/suite-base/src/panels/Tab/DraggableToolbarTab.tsx +++ b/packages/suite-base/src/panels/Tab/DraggableToolbarTab.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useDrag, useDrop, DropTargetMonitor, ConnectableElement } from "react-dnd"; + import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { TAB_DRAG_TYPE, TabActions } from "@lichtblick/suite-base/panels/Tab/TabDndContext"; import { ToolbarTab } from "@lichtblick/suite-base/panels/Tab/ToolbarTab"; import { TabLocation } from "@lichtblick/suite-base/types/layouts"; -import { useDrag, useDrop, DropTargetMonitor, ConnectableElement } from "react-dnd"; type Props = { isActive: boolean; diff --git a/packages/suite-base/src/panels/Tab/TabDndContext.ts b/packages/suite-base/src/panels/Tab/TabDndContext.ts index 7dd8178ab4..c78deac66b 100644 --- a/packages/suite-base/src/panels/Tab/TabDndContext.ts +++ b/packages/suite-base/src/panels/Tab/TabDndContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Tab/TabbedToolbar.tsx b/packages/suite-base/src/panels/Tab/TabbedToolbar.tsx index 2383e36e9c..ecbac0c707 100644 --- a/packages/suite-base/src/panels/Tab/TabbedToolbar.tsx +++ b/packages/suite-base/src/panels/Tab/TabbedToolbar.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import AddIcon from "@mui/icons-material/Add"; +import { ButtonBase } from "@mui/material"; +import { useEffect } from "react"; +import { DropTargetMonitor, useDrop } from "react-dnd"; +import { makeStyles } from "tss-react/mui"; + import PanelToolbar, { PANEL_TOOLBAR_MIN_HEIGHT, } from "@lichtblick/suite-base/components/PanelToolbar"; @@ -23,11 +32,6 @@ import { TabActions, } from "@lichtblick/suite-base/panels/Tab/TabDndContext"; import { TabConfig } from "@lichtblick/suite-base/types/layouts"; -import AddIcon from "@mui/icons-material/Add"; -import { ButtonBase } from "@mui/material"; -import { useEffect } from "react"; -import { DropTargetMonitor, useDrop } from "react-dnd"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ root: { diff --git a/packages/suite-base/src/panels/Tab/ToolbarTab.stories.tsx b/packages/suite-base/src/panels/Tab/ToolbarTab.stories.tsx index 8363011877..af6bbae4ec 100644 --- a/packages/suite-base/src/panels/Tab/ToolbarTab.stories.tsx +++ b/packages/suite-base/src/panels/Tab/ToolbarTab.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { ToolbarTab } from "@lichtblick/suite-base/panels/Tab/ToolbarTab"; import { StoryObj } from "@storybook/react"; import * as _ from "lodash-es"; import React, { ReactNode } from "react"; +import { ToolbarTab } from "@lichtblick/suite-base/panels/Tab/ToolbarTab"; + const baseProps = { hidden: false, highlight: undefined, diff --git a/packages/suite-base/src/panels/Tab/ToolbarTab.tsx b/packages/suite-base/src/panels/Tab/ToolbarTab.tsx index e726db84e9..813860c35a 100644 --- a/packages/suite-base/src/panels/Tab/ToolbarTab.tsx +++ b/packages/suite-base/src/panels/Tab/ToolbarTab.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,15 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { PANEL_TOOLBAR_MIN_HEIGHT } from "@lichtblick/suite-base/components/PanelToolbar"; -import { TabActions } from "@lichtblick/suite-base/panels/Tab/TabDndContext"; +import { fontSansSerif } from "@foxglove/theme"; import CloseIcon from "@mui/icons-material/Close"; import { IconButton, InputBase } from "@mui/material"; import React, { Ref as ReactRef, useCallback, useEffect, useMemo, useRef, useState } from "react"; import textMetrics from "text-metrics"; import { makeStyles } from "tss-react/mui"; -import { fontSansSerif } from "@foxglove/theme"; +import { PANEL_TOOLBAR_MIN_HEIGHT } from "@lichtblick/suite-base/components/PanelToolbar"; +import { TabActions } from "@lichtblick/suite-base/panels/Tab/TabDndContext"; const MAX_TAB_WIDTH = 120; const MIN_ACTIVE_TAB_WIDTH = 40; diff --git a/packages/suite-base/src/panels/Tab/index.stories.tsx b/packages/suite-base/src/panels/Tab/index.stories.tsx index de7819a8c3..8e489af077 100644 --- a/packages/suite-base/src/panels/Tab/index.stories.tsx +++ b/packages/suite-base/src/panels/Tab/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useTheme } from "@mui/material"; +import { expect } from "@storybook/jest"; +import { StoryObj, Meta } from "@storybook/react"; +import { fireEvent, within } from "@storybook/testing-library"; + import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelCatalog as PanelCatalogComponent } from "@lichtblick/suite-base/components/PanelCatalog"; import PanelLayout from "@lichtblick/suite-base/components/PanelLayout"; @@ -20,14 +28,9 @@ import { nestedTabLayoutFixture, nestedTabLayoutFixture2, } from "@lichtblick/suite-base/panels/Tab/nestedTabLayoutFixture"; +import { TabPanelConfig } from "@lichtblick/suite-base/src/types/layouts"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { ExpectedResult } from "@lichtblick/suite-base/stories/storyHelpers"; -import { useTheme } from "@mui/material"; -import { expect } from "@storybook/jest"; -import { StoryObj, Meta } from "@storybook/react"; -import { fireEvent, within } from "@storybook/testing-library"; - -import { TabPanelConfig } from "@lichtblick/suite-base/src/types/layouts"; import Tab from "./index"; diff --git a/packages/suite-base/src/panels/Tab/index.tsx b/packages/suite-base/src/panels/Tab/index.tsx index 25d7565608..eb6f8dc777 100644 --- a/packages/suite-base/src/panels/Tab/index.tsx +++ b/packages/suite-base/src/panels/Tab/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useCallback, useMemo, useState } from "react"; +import { MosaicNode } from "react-mosaic-component"; +import { makeStyles } from "tss-react/mui"; + import { EmptyPanelLayout } from "@lichtblick/suite-base/components/EmptyPanelLayout"; import Panel from "@lichtblick/suite-base/components/Panel"; import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; @@ -25,9 +32,6 @@ import { TabPanelConfig as Config } from "@lichtblick/suite-base/types/layouts"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { TAB_PANEL_TYPE } from "@lichtblick/suite-base/util/globalConstants"; import { DEFAULT_TAB_PANEL_CONFIG, updateTabPanelLayout } from "@lichtblick/suite-base/util/layout"; -import { useCallback, useMemo, useState } from "react"; -import { MosaicNode } from "react-mosaic-component"; -import { makeStyles } from "tss-react/mui"; const useStyles = makeStyles()((theme) => ({ panelCover: { diff --git a/packages/suite-base/src/panels/Tab/nestedTabLayoutFixture.ts b/packages/suite-base/src/panels/Tab/nestedTabLayoutFixture.ts index 0fa2caf73a..12341bc209 100644 --- a/packages/suite-base/src/panels/Tab/nestedTabLayoutFixture.ts +++ b/packages/suite-base/src/panels/Tab/nestedTabLayoutFixture.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Table/Table.tsx b/packages/suite-base/src/panels/Table/Table.tsx index 3027156ff4..34359d3669 100644 --- a/packages/suite-base/src/panels/Table/Table.tsx +++ b/packages/suite-base/src/panels/Table/Table.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,8 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import Stack from "@lichtblick/suite-base/components/Stack"; import PlusIcon from "@mui/icons-material/AddBoxOutlined"; import MinusIcon from "@mui/icons-material/IndeterminateCheckBoxOutlined"; import KeyboardArrowLeftIcon from "@mui/icons-material/KeyboardArrowLeft"; @@ -34,6 +35,9 @@ import { import memoizeWeak from "memoize-weak"; import { makeStyles } from "tss-react/mui"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import Stack from "@lichtblick/suite-base/components/Stack"; + import TableCell from "./TableCell"; import { sanitizeAccessorPath } from "./sanitizeAccessorPath"; import { CellValue } from "./types"; diff --git a/packages/suite-base/src/panels/Table/TableCell.tsx b/packages/suite-base/src/panels/Table/TableCell.tsx index 611d38cdb2..864ba1b53e 100644 --- a/packages/suite-base/src/panels/Table/TableCell.tsx +++ b/packages/suite-base/src/panels/Table/TableCell.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,13 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { CellValue } from "@lichtblick/suite-base/panels/Table/types"; import MinusIcon from "@mui/icons-material/IndeterminateCheckBoxOutlined"; import { IconButton } from "@mui/material"; import { Row } from "@tanstack/react-table"; import { PropsWithChildren } from "react"; import { makeStyles } from "tss-react/mui"; +import { CellValue } from "@lichtblick/suite-base/panels/Table/types"; + import { sanitizeAccessorPath } from "./sanitizeAccessorPath"; const useStyles = makeStyles()((theme) => ({ diff --git a/packages/suite-base/src/panels/Table/index.stories.tsx b/packages/suite-base/src/panels/Table/index.stories.tsx index abdf5d52d1..2f06451ab5 100644 --- a/packages/suite-base/src/panels/Table/index.stories.tsx +++ b/packages/suite-base/src/panels/Table/index.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { fireEvent, userEvent, within } from "@storybook/testing-library"; + import Table from "@lichtblick/suite-base/panels/Table"; import { mockMessage } from "@lichtblick/suite-base/players/TopicAliasingPlayer/mocks"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { fireEvent, userEvent, within } from "@storybook/testing-library"; const makeArrayData = ({ length = 50, diff --git a/packages/suite-base/src/panels/Table/index.tsx b/packages/suite-base/src/panels/Table/index.tsx index ee46102fb9..73b19a8770 100644 --- a/packages/suite-base/src/panels/Table/index.tsx +++ b/packages/suite-base/src/panels/Table/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { parseMessagePath, MessagePath } from "@foxglove/message-path"; +import { useEffect } from "react"; +import { makeStyles } from "tss-react/mui"; + import { useMessagesByTopic } from "@lichtblick/suite-base/PanelAPI"; import EmptyState from "@lichtblick/suite-base/components/EmptyState"; import MessagePathInput from "@lichtblick/suite-base/components/MessagePathSyntax/MessagePathInput"; @@ -20,10 +27,6 @@ import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext" import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; import Stack from "@lichtblick/suite-base/components/Stack"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { useEffect } from "react"; -import { makeStyles } from "tss-react/mui"; - -import { parseMessagePath, MessagePath } from "@foxglove/message-path"; import Table from "./Table"; diff --git a/packages/suite-base/src/panels/Table/sanitizeAccessorPath.ts b/packages/suite-base/src/panels/Table/sanitizeAccessorPath.ts index 1031cd742d..8ef5e2d432 100644 --- a/packages/suite-base/src/panels/Table/sanitizeAccessorPath.ts +++ b/packages/suite-base/src/panels/Table/sanitizeAccessorPath.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Table/types.ts b/packages/suite-base/src/panels/Table/types.ts index 912cabd75a..2e7a1fee42 100644 --- a/packages/suite-base/src/panels/Table/types.ts +++ b/packages/suite-base/src/panels/Table/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Teleop/DirectionalPad.stories.tsx b/packages/suite-base/src/panels/Teleop/DirectionalPad.stories.tsx index f7879255e4..a4f2b27ccd 100644 --- a/packages/suite-base/src/panels/Teleop/DirectionalPad.stories.tsx +++ b/packages/suite-base/src/panels/Teleop/DirectionalPad.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/Teleop/DirectionalPad.tsx b/packages/suite-base/src/panels/Teleop/DirectionalPad.tsx index d6f47cce69..d42d735e4d 100644 --- a/packages/suite-base/src/panels/Teleop/DirectionalPad.tsx +++ b/packages/suite-base/src/panels/Teleop/DirectionalPad.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; import { alpha } from "@mui/material"; import { useCallback, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; + const useStyles = makeStyles()((theme, _params, classes) => ({ svg: { label: "DirectionalPad-svg", diff --git a/packages/suite-base/src/panels/Teleop/TeleopPanel.tsx b/packages/suite-base/src/panels/Teleop/TeleopPanel.tsx index 5f22d43941..029e9d46dd 100644 --- a/packages/suite-base/src/panels/Teleop/TeleopPanel.tsx +++ b/packages/suite-base/src/panels/Teleop/TeleopPanel.tsx @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ros1 } from "@foxglove/rosmsg-msgs-common"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useLayoutEffect, useState } from "react"; +import { DeepPartial } from "ts-essentials"; + import { PanelExtensionContext, SettingsTreeAction, @@ -12,11 +20,6 @@ import { import EmptyState from "@lichtblick/suite-base/components/EmptyState"; import Stack from "@lichtblick/suite-base/components/Stack"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useLayoutEffect, useState } from "react"; -import { DeepPartial } from "ts-essentials"; - -import { ros1 } from "@foxglove/rosmsg-msgs-common"; import DirectionalPad, { DirectionalPadAction } from "./DirectionalPad"; diff --git a/packages/suite-base/src/panels/Teleop/index.stories.tsx b/packages/suite-base/src/panels/Teleop/index.stories.tsx index 423ea40c2a..c298de30d7 100644 --- a/packages/suite-base/src/panels/Teleop/index.stories.tsx +++ b/packages/suite-base/src/panels/Teleop/index.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { action } from "@storybook/addon-actions"; import { StoryFn, StoryContext, StoryObj } from "@storybook/react"; +import { PlayerCapabilities } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import TeleopPanel from "./index"; export default { diff --git a/packages/suite-base/src/panels/Teleop/index.tsx b/packages/suite-base/src/panels/Teleop/index.tsx index 005190165d..9db95bf21e 100644 --- a/packages/suite-base/src/panels/Teleop/index.tsx +++ b/packages/suite-base/src/panels/Teleop/index.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useMemo } from "react"; + import { useCrash } from "@lichtblick/hooks"; import { PanelExtensionContext } from "@lichtblick/suite"; import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; @@ -9,7 +14,6 @@ import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { StrictMode, useMemo } from "react"; import TeleopPanel from "./TeleopPanel"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/DynamicBufferGeometry.ts b/packages/suite-base/src/panels/ThreeDeeRender/DynamicBufferGeometry.ts index 8b5fc505d6..1309fc1648 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/DynamicBufferGeometry.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/DynamicBufferGeometry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -29,7 +32,7 @@ export class DynamicBufferGeometry extends THREE.BufferGeometry { name: string, arrayConstructor: C, itemSize: number, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters normalized?: boolean, ): THREE.BufferGeometry { const data = new arrayConstructor(this.#itemCapacity * itemSize); diff --git a/packages/suite-base/src/panels/ThreeDeeRender/DynamicInstancedMesh.ts b/packages/suite-base/src/panels/ThreeDeeRender/DynamicInstancedMesh.ts index 51dc4c26db..0b6b7ba278 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/DynamicInstancedMesh.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/DynamicInstancedMesh.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/HUD.tsx b/packages/suite-base/src/panels/ThreeDeeRender/HUD.tsx index 06fc4d24d5..b5acf3c3e8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/HUD.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/HUD.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import { IRenderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; import { Chip } from "@mui/material"; import * as _ from "lodash-es"; import * as React from "react"; import tc from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import { IRenderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; + import { HUDItem } from "./HUDItemManager"; import { useRendererProperty } from "./RendererContext"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.test.ts index 9bb8d212fd..67a8efb7be 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.ts b/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.ts index 0e7c12bf69..95c3eabc2b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/HUDItemManager.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -68,7 +71,7 @@ export class HUDItemManager { } } - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public displayIfTrue(value: boolean, hudItem: HUDItem): void { if (value) { this.addHUDItem(hudItem); diff --git a/packages/suite-base/src/panels/ThreeDeeRender/IRenderer.ts b/packages/suite-base/src/panels/ThreeDeeRender/IRenderer.ts index 3b6ccc12eb..e46dc71d80 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/IRenderer.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/IRenderer.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { LabelPool } from "@foxglove/three-text"; +import EventEmitter from "eventemitter3"; +import * as THREE from "three"; + import { Immutable, MessageEvent, @@ -19,10 +26,6 @@ import { import { HUDItemManager } from "@lichtblick/suite-base/panels/ThreeDeeRender/HUDItemManager"; import { ICameraHandler } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/ICameraHandler"; import IAnalytics from "@lichtblick/suite-base/services/IAnalytics"; -import EventEmitter from "eventemitter3"; -import * as THREE from "three"; - -import { LabelPool } from "@foxglove/three-text"; import { HUDItem } from "./HUDItemManager"; import { Input } from "./Input"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Input.ts b/packages/suite-base/src/panels/ThreeDeeRender/Input.ts index 165176014d..96f81bbaed 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Input.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Input.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interaction.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interaction.stories.tsx index 49d44e7b92..c367684e17 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interaction.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interaction.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,13 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Stack from "@lichtblick/suite-base/components/Stack"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { PointCloud2 } from "@lichtblick/suite-base/types/Messages"; import { useTheme } from "@mui/material"; import { StoryFn, StoryObj } from "@storybook/react"; import { PropsWithChildren } from "react"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import { PointCloud2 } from "@lichtblick/suite-base/types/Messages"; + import Interactions, { OBJECT_TAB_TYPE } from "./Interactions"; const markerObject = { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.stories.tsx index 519e7ae4d5..2b1068bc15 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.tsx index 361faeb346..90989b0a04 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/InteractionContextMenu.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { BaseMarker, InstancedLineListMarker } from "@lichtblick/suite-base/types/Messages"; import { Menu, MenuItem, MenuProps } from "@mui/material"; import { useCallback } from "react"; +import { BaseMarker, InstancedLineListMarker } from "@lichtblick/suite-base/types/Messages"; + import { Interactive, SelectedObject } from "./types"; import { MouseEventObject } from "../camera"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interactions.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interactions.tsx index 419b58f313..98abe4af01 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interactions.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/Interactions.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,13 @@ // You may not use this file except in compliance with the License. import { Cursor20Regular } from "@fluentui/react-icons"; +import { Typography } from "@mui/material"; + import type { LayoutActions } from "@lichtblick/suite"; import ExpandingToolbar, { ToolGroup, ToolGroupFixedSizePane, } from "@lichtblick/suite-base/components/ExpandingToolbar"; -import { Typography } from "@mui/material"; import ObjectDetails from "./ObjectDetails"; import TopicLink from "./TopicLink"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/ObjectDetails.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/ObjectDetails.tsx index ce814186d0..b961a0b828 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/ObjectDetails.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/ObjectDetails.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; +import Tree from "react-json-tree"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { RosValue } from "@lichtblick/suite-base/players/types"; import { getItemString } from "@lichtblick/suite-base/util/getItemString"; import { useJsonTreeTheme } from "@lichtblick/suite-base/util/globalConstants"; -import * as _ from "lodash-es"; -import Tree from "react-json-tree"; import { InteractionData } from "./types"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/TopicLink.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/TopicLink.tsx index d07c79f2b1..0d799eb3d3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/TopicLink.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/TopicLink.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import type { LayoutActions } from "@lichtblick/suite"; -import Stack from "@lichtblick/suite-base/components/Stack"; import OpenInNewIcon from "@mui/icons-material/OpenInNew"; import SettingsIcon from "@mui/icons-material/Settings"; import { IconButton, Typography } from "@mui/material"; +import type { LayoutActions } from "@lichtblick/suite"; +import Stack from "@lichtblick/suite-base/components/Stack"; + type Props = { topic: string; addPanel: LayoutActions["addPanel"]; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/index.ts b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/index.ts index 386c60d5a0..6971ab397e 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/index.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/types.ts b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/types.ts index 44cfcf5150..afadbfca8c 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Interactions/types.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Interactions/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/LayerErrors.ts b/packages/suite-base/src/panels/ThreeDeeRender/LayerErrors.ts index 0b3dc85f37..cbce8a3650 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/LayerErrors.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/LayerErrors.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import EventEmitter from "eventemitter3"; +import Logger from "@lichtblick/log"; + export type Path = ReadonlyArray; const TOPIC_PATH: [string, string] = ["topics", ""]; @@ -117,7 +121,7 @@ export class LayerErrors extends EventEmitter { * @param errorId - id unique to error * @param errorMessage - error message */ - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public errorIfFalse(value: boolean, path: Path, errorId: string, errorMessage: string): void { if (!value) { this.add(path, errorId, errorMessage); diff --git a/packages/suite-base/src/panels/ThreeDeeRender/LineMaterialWithAlphaVertex.ts b/packages/suite-base/src/panels/ThreeDeeRender/LineMaterialWithAlphaVertex.ts index 10aa51828e..8c7186d1e5 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/LineMaterialWithAlphaVertex.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/LineMaterialWithAlphaVertex.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/ModelCache.ts b/packages/suite-base/src/panels/ThreeDeeRender/ModelCache.ts index abf2c9db8b..729cac24a9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/ModelCache.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/ModelCache.ts @@ -1,9 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { BuiltinPanelExtensionContext } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { MeshoptDecoder } from "meshoptimizer"; import * as THREE from "three"; import dracoDecoderWasmUrl from "three/examples/jsm/libs/draco/draco_decoder.wasm"; @@ -14,6 +15,9 @@ import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; import { OBJLoader } from "three/examples/jsm/loaders/OBJLoader"; import { STLLoader } from "three/examples/jsm/loaders/STLLoader"; +import Logger from "@lichtblick/log"; +import { BuiltinPanelExtensionContext } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; + const log = Logger.getLogger(__filename); export type MeshUpAxis = "y_up" | "z_up"; @@ -182,7 +186,7 @@ export class ModelCache { async #loadCollada( url: string, text: string, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters ignoreUpAxis: boolean, reportError: ErrorCallback, ): Promise { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Picker.ts b/packages/suite-base/src/panels/ThreeDeeRender/Picker.ts index dba40fd60b..3896fb7131 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Picker.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Picker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Renderable.ts b/packages/suite-base/src/panels/ThreeDeeRender/Renderable.ts index bd1ed7b36d..633f80f28f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Renderable.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Renderable.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { RosValue } from "@lichtblick/suite-base/players/types"; import * as THREE from "three"; +import type { RosValue } from "@lichtblick/suite-base/players/types"; + import type { IRenderer } from "./IRenderer"; import type { BaseSettings } from "./settings"; import type { Pose } from "./transforms"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Renderer.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/Renderer.test.ts index cdb03fc266..248942b839 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Renderer.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Renderer.test.ts @@ -1,8 +1,14 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromNanoSec, toNanoSec } from "@foxglove/rostime"; +import { setupJestCanvasMock } from "jest-canvas-mock"; + import { MessageEvent } from "@lichtblick/suite"; import { Asset } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { Renderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/Renderer"; @@ -11,9 +17,6 @@ import { DEFAULT_CAMERA_STATE } from "@lichtblick/suite-base/panels/ThreeDeeRend import { CameraStateSettings } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/CameraStateSettings"; import { DEFAULT_PUBLISH_SETTINGS } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/PublishSettings"; import { TFMessage } from "@lichtblick/suite-base/panels/ThreeDeeRender/ros"; -import { setupJestCanvasMock } from "jest-canvas-mock"; - -import { fromNanoSec, toNanoSec } from "@foxglove/rostime"; import { RendererConfig } from "./IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Renderer.ts b/packages/suite-base/src/panels/ThreeDeeRender/Renderer.ts index a5c1069337..48756c7d32 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Renderer.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/Renderer.ts @@ -1,7 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, fromNanoSec, isLessThan, toNanoSec } from "@foxglove/rostime"; +import type { FrameTransform, FrameTransforms, SceneUpdate } from "@foxglove/schemas"; +import { palette, fontMonospace } from "@foxglove/theme"; +import { LabelMaterial, LabelPool } from "@foxglove/three-text"; +import EventEmitter from "eventemitter3"; +import { quat, vec3 } from "gl-matrix"; +import i18next from "i18next"; +import { produce } from "immer"; +import * as THREE from "three"; +import { DeepPartial, assert } from "ts-essentials"; +import { v4 as uuidv4 } from "uuid"; + import { ObjectPool } from "@lichtblick/den/collection"; import Logger from "@lichtblick/log"; import { @@ -26,18 +41,6 @@ import { HUDItemManager } from "@lichtblick/suite-base/panels/ThreeDeeRender/HUD import { LayerErrors } from "@lichtblick/suite-base/panels/ThreeDeeRender/LayerErrors"; import { ICameraHandler } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/ICameraHandler"; import IAnalytics from "@lichtblick/suite-base/services/IAnalytics"; -import EventEmitter from "eventemitter3"; -import { quat, vec3 } from "gl-matrix"; -import i18next from "i18next"; -import { produce } from "immer"; -import * as THREE from "three"; -import { DeepPartial, assert } from "ts-essentials"; -import { v4 as uuidv4 } from "uuid"; - -import { Time, fromNanoSec, isLessThan, toNanoSec } from "@foxglove/rostime"; -import type { FrameTransform, FrameTransforms, SceneUpdate } from "@foxglove/schemas"; -import { palette, fontMonospace } from "@foxglove/theme"; -import { LabelMaterial, LabelPool } from "@foxglove/three-text"; import { HUDItem } from "./HUDItemManager"; import { @@ -842,7 +845,7 @@ export class Renderer extends EventEmitter implements IRenderer } /** Enable or disable object selection mode */ - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public setPickingEnabled(enabled: boolean): void { this.#pickingEnabled = enabled; if (!enabled) { @@ -1328,7 +1331,7 @@ export class Renderer extends EventEmitter implements IRenderer } log.debug(`handleTopicsAction(${action.payload.id})`); - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters const toggleTopicVisibility = (value: boolean) => { for (const extension of this.sceneExtensions.values()) { for (const node of extension.settingsNodes()) { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/RendererContext.ts b/packages/suite-base/src/panels/ThreeDeeRender/RendererContext.ts index cac17f96a8..400a097730 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/RendererContext.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/RendererContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/RendererOverlay.tsx b/packages/suite-base/src/panels/ThreeDeeRender/RendererOverlay.tsx index c1c981e6a5..146b2b9094 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/RendererOverlay.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/RendererOverlay.tsx @@ -1,18 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { Ruler20Filled, Ruler20Regular } from "@fluentui/react-icons"; -import { LayoutActions } from "@lichtblick/suite"; -import { - PanelContextMenu, - PanelContextMenuItem, -} from "@lichtblick/suite-base/components/PanelContextMenu"; -import PublishGoalIcon from "@lichtblick/suite-base/components/PublishGoalIcon"; -import PublishPointIcon from "@lichtblick/suite-base/components/PublishPointIcon"; -import PublishPoseEstimateIcon from "@lichtblick/suite-base/components/PublishPoseEstimateIcon"; -import { usePanelMousePresence } from "@lichtblick/suite-base/hooks/usePanelMousePresence"; -import { HUD } from "@lichtblick/suite-base/panels/ThreeDeeRender/HUD"; import { Button, IconButton, @@ -30,6 +23,17 @@ import { useLongPress } from "react-use"; import tc from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import { LayoutActions } from "@lichtblick/suite"; +import { + PanelContextMenu, + PanelContextMenuItem, +} from "@lichtblick/suite-base/components/PanelContextMenu"; +import PublishGoalIcon from "@lichtblick/suite-base/components/PublishGoalIcon"; +import PublishPointIcon from "@lichtblick/suite-base/components/PublishPointIcon"; +import PublishPoseEstimateIcon from "@lichtblick/suite-base/components/PublishPoseEstimateIcon"; +import { usePanelMousePresence } from "@lichtblick/suite-base/hooks/usePanelMousePresence"; +import { HUD } from "@lichtblick/suite-base/panels/ThreeDeeRender/HUD"; + import { InteractionContextMenu, Interactions, SelectionObject, TabType } from "./Interactions"; import type { PickedRenderable } from "./Picker"; import { Renderable } from "./Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/SceneExtension.ts b/packages/suite-base/src/panels/ThreeDeeRender/SceneExtension.ts index 09dafc270c..c939f5f62f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/SceneExtension.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/SceneExtension.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent, SettingsTreeAction } from "@lichtblick/suite"; -import { PanelContextMenuItem } from "@lichtblick/suite-base/components/PanelContextMenu"; -import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import * as _ from "lodash-es"; import * as THREE from "three"; import { DeepPartial, Writable } from "ts-essentials"; +import { MessageEvent, SettingsTreeAction } from "@lichtblick/suite"; +import { PanelContextMenuItem } from "@lichtblick/suite-base/components/PanelContextMenu"; +import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; + import type { AnyRendererSubscription, IRenderer, RendererConfig } from "./IRenderer"; import { Path } from "./LayerErrors"; import { Renderable } from "./Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/SceneExtensionConfig.ts b/packages/suite-base/src/panels/ThreeDeeRender/SceneExtensionConfig.ts index c467bd636c..5a34cbd935 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/SceneExtensionConfig.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/SceneExtensionConfig.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/ScreenOverlay.ts b/packages/suite-base/src/panels/ThreeDeeRender/ScreenOverlay.ts index 3311218c07..0cb15eef23 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/ScreenOverlay.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/ScreenOverlay.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/SettingsManager.ts b/packages/suite-base/src/panels/ThreeDeeRender/SettingsManager.ts index 0652f6c3d1..c7b941e2c9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/SettingsManager.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/SettingsManager.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; import EventEmitter from "eventemitter3"; import { produce } from "immer"; +import { SettingsTreeAction, SettingsTreeNode, SettingsTreeNodes } from "@lichtblick/suite"; + import { LayerErrors, Path } from "./LayerErrors"; export type ActionHandler = (action: SettingsTreeAction) => void; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/SharedGeometry.ts b/packages/suite-base/src/panels/ThreeDeeRender/SharedGeometry.ts index e20c3828a7..624d7d3802 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/SharedGeometry.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/SharedGeometry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/Stats.tsx b/packages/suite-base/src/panels/ThreeDeeRender/Stats.tsx index ab3c1e64e1..5d7e535ba5 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/Stats.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/Stats.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx b/packages/suite-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx index badbb32c39..92a1ad84bf 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/ThreeDeeRender.tsx @@ -1,7 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, toNanoSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; +import { useSnackbar } from "notistack"; +import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; +import ReactDOM from "react-dom"; +import { useLatest } from "react-use"; +import { DeepPartial } from "ts-essentials"; +import { useDebouncedCallback } from "use-debounce"; + import Logger from "@lichtblick/log"; import { Immutable, @@ -22,15 +34,6 @@ import { SceneExtensionConfig, } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtensionConfig"; import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; -import * as _ from "lodash-es"; -import { useSnackbar } from "notistack"; -import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react"; -import ReactDOM from "react-dom"; -import { useLatest } from "react-use"; -import { DeepPartial } from "ts-essentials"; -import { useDebouncedCallback } from "use-debounce"; - -import { Time, toNanoSec } from "@foxglove/rostime"; import type { FollowMode, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/camera.ts b/packages/suite-base/src/panels/ThreeDeeRender/camera.ts index 80f853a6d6..ec2dcf2dd3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/camera.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/camera.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/color.ts b/packages/suite-base/src/panels/ThreeDeeRender/color.ts index 7898900a97..5dd289adbe 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/color.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/color.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/dispose.ts b/packages/suite-base/src/panels/ThreeDeeRender/dispose.ts index 11f11d6d7c..061ce9d2a8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/dispose.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/dispose.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/foxglove.ts b/packages/suite-base/src/panels/ThreeDeeRender/foxglove.ts index bcc533d0f9..500c597e82 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/foxglove.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/foxglove.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/index.tsx b/packages/suite-base/src/panels/ThreeDeeRender/index.tsx index 2d2386fe0b..16159fa62b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/index.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/index.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useMemo } from "react"; +import { DeepPartial } from "ts-essentials"; + import { useCrash } from "@lichtblick/hooks"; import { CaptureErrorBoundary } from "@lichtblick/suite-base/components/CaptureErrorBoundary"; import { @@ -18,8 +24,6 @@ import { INJECTED_FEATURE_KEYS, useAppContext } from "@lichtblick/suite-base/con import { TestOptions } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { StrictMode, useMemo } from "react"; -import { DeepPartial } from "ts-essentials"; import { SceneExtensionConfig } from "./SceneExtensionConfig"; import { ThreeDeeRender } from "./ThreeDeeRender"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/lod.ts b/packages/suite-base/src/panels/ThreeDeeRender/lod.ts index 9dd2a05a6a..8f02d62e8b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/lod.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/lod.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/math.ts b/packages/suite-base/src/panels/ThreeDeeRender/math.ts index 19cb1ef75c..a2ca5a30ac 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/math.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/math.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/normalizeMessages.ts b/packages/suite-base/src/panels/ThreeDeeRender/normalizeMessages.ts index 4d7f2eb2cd..4fa4ae62a0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/normalizeMessages.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/normalizeMessages.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/publish.ts b/packages/suite-base/src/panels/ThreeDeeRender/publish.ts index 12c155196b..2501a49177 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/publish.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/publish.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Point, makeCovarianceArray } from "@lichtblick/suite-base/util/geometry"; import { MessageDefinition } from "@foxglove/message-definition"; import { ros1, ros2galactic } from "@foxglove/rosmsg-msgs-common"; import { fromDate } from "@foxglove/rostime"; +import { Point, makeCovarianceArray } from "@lichtblick/suite-base/util/geometry"; + import { Pose } from "./transforms/geometry"; export const PublishRos1Datatypes = new Map( diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Axis.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Axis.ts index 36339bd36a..1e5652cead 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Axis.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Axis.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.ts index 554fec217c..4f73675d0b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { t } from "i18next"; +import * as _ from "lodash-es"; +import * as THREE from "three"; +import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; + import { SettingsTreeAction } from "@lichtblick/suite"; import { ICameraHandler } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/ICameraHandler"; import { @@ -11,10 +19,6 @@ import { UserFrameId, makePose, } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; -import { t } from "i18next"; -import * as _ from "lodash-es"; -import * as THREE from "three"; -import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; import type { FollowMode, IRenderer } from "../IRenderer"; import { SceneExtension } from "../SceneExtension"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Cameras.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Cameras.ts index 2ffc27df24..cdef69a30a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Cameras.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Cameras.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import { CameraCalibration } from "@foxglove/schemas"; +import { t } from "i18next"; + import { PinholeCameraModel } from "@lichtblick/den/image"; import Logger from "@lichtblick/log"; import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; import type { RosValue } from "@lichtblick/suite-base/players/types"; -import { t } from "i18next"; - -import { toNanoSec } from "@foxglove/rostime"; -import { CameraCalibration } from "@foxglove/schemas"; import { RenderableLineList } from "./markers/RenderableLineList"; import { cameraInfosEqual, normalizeCameraInfo, projectPixel } from "./projections"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/FoxgloveGrid.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/FoxgloveGrid.ts index e325e13788..664476d8bd 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/FoxgloveGrid.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/FoxgloveGrid.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import { Grid, NumericType, PackedElementField } from "@foxglove/schemas"; +import * as THREE from "three"; + import { SettingsTreeAction } from "@lichtblick/suite"; import { GRID_DATATYPES } from "@lichtblick/suite-base/panels/ThreeDeeRender/foxglove"; import type { RosValue } from "@lichtblick/suite-base/players/types"; -import * as THREE from "three"; - -import { toNanoSec } from "@foxglove/rostime"; -import { Grid, NumericType, PackedElementField } from "@foxglove/schemas"; import { ColorModeSettings, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/FrameAxes.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/FrameAxes.ts index bd48764a76..7845e66878 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/FrameAxes.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/FrameAxes.ts @@ -1,14 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { - Immutable, - SettingsTreeAction, - SettingsTreeChildren, - SettingsTreeFields, -} from "@lichtblick/suite"; -import type { RosValue } from "@lichtblick/suite-base/players/types"; +import { Label } from "@foxglove/three-text"; import { t } from "i18next"; import * as _ from "lodash-es"; import * as THREE from "three"; @@ -16,7 +13,13 @@ import { Line2 } from "three/examples/jsm/lines/Line2"; import { LineGeometry } from "three/examples/jsm/lines/LineGeometry"; import { LineMaterial } from "three/examples/jsm/lines/LineMaterial"; -import { Label } from "@foxglove/three-text"; +import { + Immutable, + SettingsTreeAction, + SettingsTreeChildren, + SettingsTreeFields, +} from "@lichtblick/suite"; +import type { RosValue } from "@lichtblick/suite-base/players/types"; import { Axis, AXIS_LENGTH } from "./Axis"; import { DEFAULT_LABEL_SCALE_FACTOR } from "./SceneSettings"; @@ -351,7 +354,7 @@ export class FrameAxes extends SceneExtension { public override handleSettingsAction = (action: SettingsTreeAction): void => { const path = action.payload.path; - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters const toggleFrameVisibility = (value: boolean) => { for (const renderable of this.renderables.values()) { renderable.userData.settings.visible = value; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Grids.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Grids.ts index 774b6e1f4d..de02c43526 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Grids.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Grids.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; import { t } from "i18next"; import * as _ from "lodash-es"; +import Logger from "@lichtblick/log"; +import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; + import { RenderableLineList } from "./markers/RenderableLineList"; import type { IRenderer } from "../IRenderer"; import { BaseUserData, Renderable } from "../Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ICameraHandler.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ICameraHandler.ts index b1e30044d1..487c8e34f0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ICameraHandler.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ICameraHandler.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SceneExtension } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtension"; import * as THREE from "three"; +import { SceneExtension } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtension"; + import { CameraState } from "../camera"; export interface ICameraHandler extends SceneExtension { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.ts index 5ab614a0e2..4254216555 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; +import * as THREE from "three"; +import { Writable } from "ts-essentials"; + import { filterMap } from "@lichtblick/den/collection"; import { PinholeCameraModel } from "@lichtblick/den/image"; import Logger from "@lichtblick/log"; @@ -39,11 +47,6 @@ import { t3D } from "@lichtblick/suite-base/panels/ThreeDeeRender/t3D"; import { makePose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; import { AppEvent } from "@lichtblick/suite-base/services/IAnalytics"; import { downloadFiles } from "@lichtblick/suite-base/util/download"; -import * as _ from "lodash-es"; -import * as THREE from "three"; -import { Writable } from "ts-essentials"; - -import { toNanoSec } from "@foxglove/rostime"; import { ImageModeCamera } from "./ImageModeCamera"; import { IMessageHandler, MessageHandler, MessageRenderState } from "./MessageHandler"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageModeCamera.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageModeCamera.ts index 433966f5f7..a14de59c4c 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageModeCamera.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageModeCamera.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PinholeCameraModel } from "@lichtblick/den/image"; import * as THREE from "three"; +import { PinholeCameraModel } from "@lichtblick/den/image"; + const DEFAULT_CAMERA_STATE = { near: 0.001, far: 1000, @@ -71,13 +75,13 @@ export class ImageModeCamera extends THREE.PerspectiveCamera { this.resetModifications(); } - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public setFlipHorizontal(flipHorizontal: boolean): void { this.#flipHorizontal = flipHorizontal; this.resetModifications(); } - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public setFlipVertical(flipVertical: boolean): void { this.#flipVertical = flipVertical; this.resetModifications(); diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.test.ts index b2db1c9485..16b283faf0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.test.ts @@ -1,7 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromNanoSec } from "@foxglove/rostime"; +import { + CameraCalibration, + CircleAnnotation, + ImageAnnotations, + PointsAnnotation, + RawImage, + TextAnnotation, +} from "@foxglove/schemas"; +import * as _ from "lodash-es"; +import { DeepPartial } from "ts-essentials"; + import { MessageEvent } from "@lichtblick/suite"; import { HUDItemManager } from "@lichtblick/suite-base/panels/ThreeDeeRender/HUDItemManager"; import { @@ -13,18 +28,6 @@ import { WAITING_FOR_SYNC_EMPTY_HUD_ITEM, WAITING_FOR_SYNC_NOTICE_HUD_ITEM, } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler"; -import * as _ from "lodash-es"; -import { DeepPartial } from "ts-essentials"; - -import { fromNanoSec } from "@foxglove/rostime"; -import { - CameraCalibration, - CircleAnnotation, - ImageAnnotations, - PointsAnnotation, - RawImage, - TextAnnotation, -} from "@foxglove/schemas"; import { PartialMessageEvent } from "../../SceneExtension"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.ts index 5a973b5d60..b4c9103581 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.ts @@ -1,7 +1,25 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { AVLTree } from "@foxglove/avl"; +import { + Time, + fromNanoSec, + toNanoSec, + compare as compareTime, + isLessThan, +} from "@foxglove/rostime"; +import { + CompressedImage, + RawImage, + ImageAnnotations as FoxgloveImageAnnotations, +} from "@foxglove/schemas"; +import * as _ from "lodash-es"; + import { Immutable, MessageEvent } from "@lichtblick/suite"; import { HUDItem, @@ -23,21 +41,6 @@ import { ImageMarker as RosImageMarker, ImageMarkerArray as RosImageMarkerArray, } from "@lichtblick/suite-base/types/Messages"; -import * as _ from "lodash-es"; - -import { AVLTree } from "@foxglove/avl"; -import { - Time, - fromNanoSec, - toNanoSec, - compare as compareTime, - isLessThan, -} from "@foxglove/rostime"; -import { - CompressedImage, - RawImage, - ImageAnnotations as FoxgloveImageAnnotations, -} from "@foxglove/schemas"; import { normalizeAnnotations } from "./annotations/normalizeAnnotations"; import { Annotation } from "./annotations/types"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/ImageAnnotations.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/ImageAnnotations.ts index 1bff1e7064..d4d6748fa9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/ImageAnnotations.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/ImageAnnotations.ts @@ -1,7 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ImageAnnotations as FoxgloveImageAnnotations } from "@foxglove/schemas"; +import { LabelPool } from "@foxglove/three-text"; +import { t } from "i18next"; +import * as THREE from "three"; +import { Opaque } from "ts-essentials"; + import { filterMap } from "@lichtblick/den/collection"; import { PinholeCameraModel } from "@lichtblick/den/image"; import { Immutable, MessageEvent, SettingsTreeAction, Topic } from "@lichtblick/suite"; @@ -11,12 +20,6 @@ import { ImageMarker as RosImageMarker, ImageMarkerArray as RosImageMarkerArray, } from "@lichtblick/suite-base/types/Messages"; -import { t } from "i18next"; -import * as THREE from "three"; -import { Opaque } from "ts-essentials"; - -import { ImageAnnotations as FoxgloveImageAnnotations } from "@foxglove/schemas"; -import { LabelPool } from "@foxglove/three-text"; import { RenderableTopicAnnotations } from "./RenderableTopicAnnotations"; import { Annotation } from "./types"; @@ -232,7 +235,7 @@ export class ImageAnnotations extends THREE.Object3D { #handleTopicVisibilityChange( topic: TopicName, - visible: boolean, // eslint-disable-line @foxglove/no-boolean-parameters + visible: boolean, // eslint-disable-line @lichtblick/no-boolean-parameters ): void { this.#context.updateConfig((draft) => { draft.annotations ??= {}; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableLineAnnotation.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableLineAnnotation.ts index 7e8c16a6c8..68620426e8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableLineAnnotation.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableLineAnnotation.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PinholeCameraModel } from "@lichtblick/den/image"; -import { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; +import { Color } from "@foxglove/schemas"; import * as THREE from "three"; import { LineGeometry } from "three/examples/jsm/lines/LineGeometry"; import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2"; import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry"; -import { Color } from "@foxglove/schemas"; +import { PinholeCameraModel } from "@lichtblick/den/image"; +import { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; import { ANNOTATION_RENDER_ORDER, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.ts index e050fc089a..aa7c3c4777 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderablePointsAnnotation.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as THREE from "three"; + import { PinholeCameraModel } from "@lichtblick/den/image"; import { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; -import * as THREE from "three"; import { ANNOTATION_RENDER_ORDER, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTextAnnotation.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTextAnnotation.ts index 1008634159..12e5d51fd8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTextAnnotation.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTextAnnotation.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Label, LabelPool } from "@foxglove/three-text"; + import { PinholeCameraModel } from "@lichtblick/den/image"; import { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; -import { Label, LabelPool } from "@foxglove/three-text"; - import { ANNOTATION_RENDER_ORDER } from "./annotationRenderOrder"; import { getAnnotationAtPath } from "./normalizeAnnotations"; import { TextAnnotation as NormalizedTextAnnotation } from "./types"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTopicAnnotations.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTopicAnnotations.ts index e607a8ac21..c298be5544 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTopicAnnotations.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/RenderableTopicAnnotations.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PinholeCameraModel } from "@lichtblick/den/image"; -import { RosObject } from "@lichtblick/suite-base/players/types"; +import { LabelPool } from "@foxglove/three-text"; import * as THREE from "three"; -import { LabelPool } from "@foxglove/three-text"; +import { PinholeCameraModel } from "@lichtblick/den/image"; +import { RosObject } from "@lichtblick/suite-base/players/types"; import { RenderableLineAnnotation } from "./RenderableLineAnnotation"; import { RenderablePointsAnnotation } from "./RenderablePointsAnnotation"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/annotationRenderOrder.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/annotationRenderOrder.ts index 8fd76c8bad..a0cb02b8fa 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/annotationRenderOrder.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/annotationRenderOrder.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.test.ts index df534b5ba1..11f2514815 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.ts index e2beb72d52..c17edca7ee 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/normalizeAnnotations.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, fromNanoSec } from "@foxglove/rostime"; +import { ImageAnnotations, PointsAnnotationType } from "@foxglove/schemas"; + import { filterMap } from "@lichtblick/den/collection"; import { RosObject } from "@lichtblick/suite-base/players/types"; import { @@ -11,9 +17,6 @@ import { } from "@lichtblick/suite-base/types/Messages"; import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; -import { Time, fromNanoSec } from "@foxglove/rostime"; -import { ImageAnnotations, PointsAnnotationType } from "@foxglove/schemas"; - import type { Annotation, PathKey, PointsAnnotation } from "./types"; // Should mirror TextAnnotation.font_size default value diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/types.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/types.ts index f8d1bea450..dd23ef8829 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/types.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/annotations/types.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { Color, Point2D } from "@lichtblick/suite-base/types/Messages"; - import type { Time } from "@foxglove/rostime"; +import type { Color, Point2D } from "@lichtblick/suite-base/types/Messages"; + export type PathKey = string | number; export type CircleAnnotation = { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/constants.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/constants.ts index aea35e97ae..bb7844e060 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/constants.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/ImageMode/constants.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images.ts index 886d19fbfb..38b309baf4 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images.ts @@ -1,17 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import { CompressedImage, RawImage } from "@foxglove/schemas"; +import { t } from "i18next"; +import { assert } from "ts-essentials"; + import { MultiMap, filterMap } from "@lichtblick/den/collection"; import { PinholeCameraModel } from "@lichtblick/den/image"; import Logger from "@lichtblick/log"; import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; import { ALL_SUPPORTED_IMAGE_SCHEMAS } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/ImageMode/ImageMode"; -import { t } from "i18next"; -import { assert } from "ts-essentials"; - -import { toNanoSec } from "@foxglove/rostime"; -import { CompressedImage, RawImage } from "@foxglove/schemas"; import { IMAGE_RENDERABLE_DEFAULT_SETTINGS, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageRenderable.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageRenderable.ts index 882a4db464..b57a71e14d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageRenderable.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageRenderable.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; +import * as THREE from "three"; +import { assert } from "ts-essentials"; + import { PinholeCameraModel } from "@lichtblick/den/image"; import Logger from "@lichtblick/log"; import { IRenderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; @@ -10,11 +18,6 @@ import { stringToRgba } from "@lichtblick/suite-base/panels/ThreeDeeRender/color import { WorkerImageDecoder } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder"; import { projectPixel } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/projections"; import { RosValue } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; -import * as THREE from "three"; -import { assert } from "ts-essentials"; - -import { toNanoSec } from "@foxglove/rostime"; import { AnyImage } from "./ImageTypes"; import { decodeCompressedImageToBitmap } from "./decodeImage"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageTypes.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageTypes.ts index 7a785cc175..96c88d1363 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageTypes.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/ImageTypes.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { CAMERA_CALIBRATION_DATATYPES } from "@lichtblick/suite-base/panels/ThreeDeeRender/foxglove"; import { Time } from "@foxglove/rostime"; import { CompressedImage, RawImage } from "@foxglove/schemas"; +import { CAMERA_CALIBRATION_DATATYPES } from "@lichtblick/suite-base/panels/ThreeDeeRender/foxglove"; + import { Image as RosImage, CompressedImage as RosCompressedImage, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.ts index d734f06442..74fb51f64f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { ComlinkWrap } from "@lichtblick/den/worker"; +import { RawImage } from "@foxglove/schemas"; import * as Comlink from "comlink"; -import { RawImage } from "@foxglove/schemas"; +import { ComlinkWrap } from "@lichtblick/den/worker"; import type { RawImageOptions } from "./decodeImage"; import { Image as RosImage } from "../../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.worker.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.worker.ts index 6c7c965fed..eca269382d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.worker.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/WorkerImageDecoder.worker.ts @@ -1,10 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as Comlink from "comlink"; - import type { RawImage } from "@foxglove/schemas"; +import * as Comlink from "comlink"; import { decodeRawImage, RawImageOptions } from "./decodeImage"; import type { Image as RosImage } from "../../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/decodeImage.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/decodeImage.ts index 1f909299fa..f219336ddb 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/decodeImage.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/decodeImage.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { RawImage } from "@foxglove/schemas"; +import * as _ from "lodash-es"; + import { decodeBGR8, decodeBGRA8, @@ -17,9 +23,6 @@ import { decodeUYVY, decodeYUYV, } from "@lichtblick/den/image"; -import * as _ from "lodash-es"; - -import { RawImage } from "@foxglove/schemas"; import { CompressedImageTypes } from "./ImageTypes"; import { Image as RosImage } from "../../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/imageNormalizers.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/imageNormalizers.ts index 0c5bc2d5c5..e0d65d6531 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/imageNormalizers.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/imageNormalizers.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PartialMessage } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtension"; - import { CompressedImage, RawImage } from "@foxglove/schemas"; +import { PartialMessage } from "@lichtblick/suite-base/panels/ThreeDeeRender/SceneExtension"; + import { normalizeByteArray, normalizeHeader, normalizeTime } from "../../normalizeMessages"; import { Image as RosImage, CompressedImage as RosCompressedImage } from "../../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.test.ts index 504fabe459..264e3b47ae 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.ts index 6e39e29229..b7fa42e074 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Images/topicPrefixMatching.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/LaserScans.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/LaserScans.ts index 79190d0aa6..05367b65ad 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/LaserScans.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/LaserScans.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, toNanoSec } from "@foxglove/rostime"; +import { LaserScan as FoxgloveLaserScan } from "@foxglove/schemas"; +import * as _ from "lodash-es"; +import * as THREE from "three"; + import { SettingsTreeAction, MessageEvent } from "@lichtblick/suite"; import { DEFAULT_POINT_SETTINGS, @@ -12,11 +20,6 @@ import { } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/pointExtensionUtils"; import type { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; import { emptyPose } from "@lichtblick/suite-base/util/Pose"; -import * as _ from "lodash-es"; -import * as THREE from "three"; - -import { Time, toNanoSec } from "@foxglove/rostime"; -import { LaserScan as FoxgloveLaserScan } from "@foxglove/schemas"; import { colorHasTransparency, getColorConverter } from "./colorMode"; import { DynamicBufferGeometry } from "../DynamicBufferGeometry"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Markers.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Markers.ts index 44829184b8..56df5944d0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Markers.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Markers.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction } from "@lichtblick/suite"; +import { toNanoSec } from "@foxglove/rostime"; import { t } from "i18next"; import * as _ from "lodash-es"; -import { toNanoSec } from "@foxglove/rostime"; +import { SettingsTreeAction } from "@lichtblick/suite"; import { LayerSettingsMarker, LayerSettingsMarkerNamespace, TopicMarkers } from "./TopicMarkers"; import type { AnyRendererSubscription, IRenderer } from "../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/MeasurementTool.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/MeasurementTool.ts index 96c0d16b5e..e315d4abd7 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/MeasurementTool.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/MeasurementTool.ts @@ -1,9 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { Label } from "@foxglove/three-text"; +import * as THREE from "three"; import type { IRenderer } from "../IRenderer"; import { Renderable } from "../Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/OccupancyGrids.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/OccupancyGrids.ts index 6bedb025d7..ed0e891f2c 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/OccupancyGrids.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/OccupancyGrids.ts @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; -import type { RosValue } from "@lichtblick/suite-base/players/types"; +import { toNanoSec } from "@foxglove/rostime"; import { t } from "i18next"; import * as THREE from "three"; -import { toNanoSec } from "@foxglove/rostime"; +import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; +import type { RosValue } from "@lichtblick/suite-base/players/types"; import type { AnyRendererSubscription, IRenderer } from "../IRenderer"; import { BaseUserData, Renderable } from "../Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PointClouds.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PointClouds.ts index 90ba367b1e..b1703ca3ff 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PointClouds.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PointClouds.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, toNanoSec } from "@foxglove/rostime"; +import { NumericType, PackedElementField, PointCloud } from "@foxglove/schemas"; +import * as _ from "lodash-es"; +import * as THREE from "three"; + import { SettingsTreeAction, MessageEvent } from "@lichtblick/suite"; import { DynamicBufferGeometry } from "@lichtblick/suite-base/panels/ThreeDeeRender/DynamicBufferGeometry"; import { @@ -18,11 +26,6 @@ import { PointsRenderable, } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/pointExtensionUtils"; import type { RosObject, RosValue } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; -import * as THREE from "three"; - -import { Time, toNanoSec } from "@foxglove/rostime"; -import { NumericType, PackedElementField, PointCloud } from "@foxglove/schemas"; import { autoSelectColorSettings, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Polygons.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Polygons.ts index e7e07c32b3..ce51f652c8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Polygons.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Polygons.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; + import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; import type { RosValue } from "@lichtblick/suite-base/players/types"; -import { toNanoSec } from "@foxglove/rostime"; - import { RenderableLineStrip } from "./markers/RenderableLineStrip"; import type { AnyRendererSubscription, IRenderer } from "../IRenderer"; import { BaseUserData, Renderable } from "../Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PoseArrays.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PoseArrays.ts index 49f956705d..84c1405b44 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PoseArrays.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PoseArrays.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeFields, Topic } from "@lichtblick/suite"; -import type { RosValue } from "@lichtblick/suite-base/players/types"; +import { toNanoSec } from "@foxglove/rostime"; +import { PosesInFrame } from "@foxglove/schemas"; import { t } from "i18next"; import * as _ from "lodash-es"; import * as THREE from "three"; -import { toNanoSec } from "@foxglove/rostime"; -import { PosesInFrame } from "@foxglove/schemas"; +import { SettingsTreeAction, SettingsTreeFields, Topic } from "@lichtblick/suite"; +import type { RosValue } from "@lichtblick/suite-base/players/types"; import { Axis, AXIS_LENGTH } from "./Axis"; import { createArrowMarker } from "./Poses"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Poses.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Poses.ts index 64c3166608..9b98b269f9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Poses.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Poses.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; -import type { RosValue } from "@lichtblick/suite-base/players/types"; +import { toNanoSec } from "@foxglove/rostime"; +import { PoseInFrame } from "@foxglove/schemas"; import { t } from "i18next"; import * as _ from "lodash-es"; import * as THREE from "three"; -import { toNanoSec } from "@foxglove/rostime"; -import { PoseInFrame } from "@foxglove/schemas"; +import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; +import type { RosValue } from "@lichtblick/suite-base/players/types"; import { Axis, AXIS_LENGTH } from "./Axis"; import { RenderableArrow } from "./markers/RenderableArrow"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishClickTool.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishClickTool.ts index 7a0f0b9866..d714fb93f4 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishClickTool.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishClickTool.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishSettings.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishSettings.ts index 9cf6ddb549..81840711b7 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishSettings.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/PublishSettings.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction } from "@lichtblick/suite"; import { t } from "i18next"; import * as _ from "lodash-es"; +import { SettingsTreeAction } from "@lichtblick/suite"; + import { PublishClickType } from "./PublishClickTool"; import type { IRenderer, RendererConfig } from "../IRenderer"; import { SceneExtension } from "../SceneExtension"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneEntities.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneEntities.ts index 43a919139c..8277bfb290 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneEntities.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneEntities.ts @@ -1,9 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction } from "@lichtblick/suite"; - import { toNanoSec } from "@foxglove/rostime"; import { ArrowPrimitive, @@ -21,6 +22,8 @@ import { TriangleListPrimitive, } from "@foxglove/schemas"; +import { SettingsTreeAction } from "@lichtblick/suite"; + import { TopicEntities } from "./TopicEntities"; import { PrimitivePool } from "./primitives/PrimitivePool"; import type { AnyRendererSubscription, IRenderer } from "../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneSettings.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneSettings.ts index c4995bab66..5d0480e71f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneSettings.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/SceneSettings.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; import { t } from "i18next"; import * as _ from "lodash-es"; +import { SettingsTreeAction, SettingsTreeFields } from "@lichtblick/suite"; + import type { IRenderer } from "../IRenderer"; import { DEFAULT_MESH_UP_AXIS } from "../ModelCache"; import { SceneExtension } from "../SceneExtension"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicEntities.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicEntities.ts index 1faed4c5dc..cfa0007941 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicEntities.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicEntities.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicMarkers.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicMarkers.ts index aa41a6ee06..c01213cbf9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicMarkers.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/TopicMarkers.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Urdfs.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Urdfs.ts index 9ce313329f..15e18eb15d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/Urdfs.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/Urdfs.ts @@ -1,7 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { toNanoSec } from "@foxglove/rostime"; +import { vec3 } from "gl-matrix"; +import i18next from "i18next"; +import * as _ from "lodash-es"; +import * as THREE from "three"; +import { v4 as uuidv4 } from "uuid"; + import { filterMap } from "@lichtblick/den/collection"; import { UrdfGeometryMesh, @@ -20,13 +30,6 @@ import { import { makeRgba, stringToRgba } from "@lichtblick/suite-base/panels/ThreeDeeRender/color"; import { eulerToQuaternion } from "@lichtblick/suite-base/util/geometry"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import { vec3 } from "gl-matrix"; -import i18next from "i18next"; -import * as _ from "lodash-es"; -import * as THREE from "three"; -import { v4 as uuidv4 } from "uuid"; - -import { toNanoSec } from "@foxglove/rostime"; import { RenderableCube } from "./markers/RenderableCube"; import { RenderableCylinder } from "./markers/RenderableCylinder"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/VelodyneScans.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/VelodyneScans.ts index f61416c769..b278d3ef0f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/VelodyneScans.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/VelodyneScans.ts @@ -1,16 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent, SettingsTreeAction } from "@lichtblick/suite"; -import { - createStixelMaterial, - PointCloudHistoryRenderable, -} from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/PointClouds"; -import type { RosObject } from "@lichtblick/suite-base/players/types"; -import { VelodyneScan } from "@lichtblick/suite-base/types/Messages"; -import * as _ from "lodash-es"; - import { toNanoSec, toSec } from "@foxglove/rostime"; import { NumericType, PointCloud as FoxglovePointCloud } from "@foxglove/schemas"; import { @@ -21,6 +15,15 @@ import { RawPacket, Transformer, } from "@foxglove/velodyne-cloud"; +import * as _ from "lodash-es"; + +import { MessageEvent, SettingsTreeAction } from "@lichtblick/suite"; +import { + createStixelMaterial, + PointCloudHistoryRenderable, +} from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/PointClouds"; +import type { RosObject } from "@lichtblick/suite-base/players/types"; +import { VelodyneScan } from "@lichtblick/suite-base/types/Messages"; import { autoSelectColorSettings } from "./colorMode"; import { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/colorMode.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/colorMode.ts index 658895ddab..711283cb48 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/colorMode.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/colorMode.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeFields, SettingsTreeNode } from "@lichtblick/suite"; -import { BaseSettings } from "@lichtblick/suite-base/panels/ThreeDeeRender/settings"; import { t } from "i18next"; import * as THREE from "three"; +import { SettingsTreeFields, SettingsTreeNode } from "@lichtblick/suite"; +import { BaseSettings } from "@lichtblick/suite-base/panels/ThreeDeeRender/settings"; + import { rgbaGradient, rgbaToLinear, SRGBToLinear, stringToRgba } from "../color"; import { clamp } from "../math"; import type { ColorRGBA } from "../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/MarkerPool.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/MarkerPool.ts index 0db86134ce..646a508901 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/MarkerPool.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/MarkerPool.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableArrow.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableArrow.ts index 2a1b83cf44..b71c86fb91 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableArrow.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableArrow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCube.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCube.ts index a24a2c75f2..3a60358649 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCube.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCube.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCubeList.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCubeList.ts index 4641e6a17a..7d4f3980f7 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCubeList.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCubeList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCylinder.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCylinder.ts index afcc0cfd33..b16a50de1e 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCylinder.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableCylinder.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineList.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineList.ts index 48768f5136..8c327b31a9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineList.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineStrip.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineStrip.ts index 50e0b682c4..bf009a257a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineStrip.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableLineStrip.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMarker.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMarker.ts index 693c36b495..91973fb4fd 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMarker.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMarker.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { RosValue } from "@lichtblick/suite-base/players/types"; +import { toNanoSec } from "@foxglove/rostime"; import * as THREE from "three"; -import { toNanoSec } from "@foxglove/rostime"; +import { RosValue } from "@lichtblick/suite-base/players/types"; import type { IRenderer } from "../../IRenderer"; import { BaseUserData, Renderable } from "../../Renderable"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMeshResource.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMeshResource.ts index fff575fd18..549ea2b2f3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMeshResource.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableMeshResource.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { EDGE_LINE_SEGMENTS_NAME } from "@lichtblick/suite-base/panels/ThreeDeeRender/ModelCache"; import * as THREE from "three"; +import { EDGE_LINE_SEGMENTS_NAME } from "@lichtblick/suite-base/panels/ThreeDeeRender/ModelCache"; + import { RenderableMarker } from "./RenderableMarker"; import { makeStandardMaterial } from "./materials"; import type { IRenderer } from "../../IRenderer"; @@ -47,7 +51,7 @@ export class RenderableMeshResource extends RenderableMarker { public override update( newMarker: Marker, receiveTime: bigint | undefined, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters forceLoad?: boolean, ): void { const prevMarker = this.userData.marker; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderablePoints.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderablePoints.ts index 48a53bf802..08f61c70d7 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderablePoints.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderablePoints.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphere.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphere.ts index 62d6f202f3..10d7d10652 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphere.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphere.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphereList.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphereList.ts index 5f159b9da2..d5b90c6545 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphereList.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableSphereList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTextViewFacing.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTextViewFacing.ts index a4ec76d517..a61df53c81 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTextViewFacing.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTextViewFacing.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTriangleList.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTriangleList.ts index c103d57146..dcaabb46df 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTriangleList.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/RenderableTriangleList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/materials.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/materials.ts index cd2d492c79..eedc508942 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/materials.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/markers/materials.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/materials/MeshStandardMaterialWithInstanceOpacity.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/materials/MeshStandardMaterialWithInstanceOpacity.ts index 249642f6d7..193794cd03 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/materials/MeshStandardMaterialWithInstanceOpacity.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/materials/MeshStandardMaterialWithInstanceOpacity.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/models.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/models.ts index e2932690e5..43f4c2799a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/models.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/models.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointClouds/fieldReaders.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointClouds/fieldReaders.ts index ef08158bc6..80131088a9 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointClouds/fieldReaders.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointClouds/fieldReaders.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -8,7 +11,7 @@ import { PointField, PointFieldType } from "../../ros"; export type FieldReader = (view: DataView, pointOffset: number) => number; -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function int8Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getInt8(pointOffset + fieldOffset); @@ -19,7 +22,7 @@ function int8Reader(fieldOffset: number, normalize: boolean): FieldReader { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function uint8Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getUint8(pointOffset + fieldOffset); @@ -30,7 +33,7 @@ function uint8Reader(fieldOffset: number, normalize: boolean): FieldReader { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function int16Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getInt16(pointOffset + fieldOffset, true); @@ -41,7 +44,7 @@ function int16Reader(fieldOffset: number, normalize: boolean): FieldReader { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function uint16Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getUint16(pointOffset + fieldOffset, true); @@ -52,7 +55,7 @@ function uint16Reader(fieldOffset: number, normalize: boolean): FieldReader { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function int32Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getInt32(pointOffset + fieldOffset, true); @@ -63,7 +66,7 @@ function int32Reader(fieldOffset: number, normalize: boolean): FieldReader { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters function uint32Reader(fieldOffset: number, normalize: boolean): FieldReader { return (view: DataView, pointOffset: number) => { const value = view.getUint32(pointOffset + fieldOffset, true); @@ -95,7 +98,7 @@ export function getReader( stride: number, /** @see https://www.khronos.org/opengl/wiki/Normalized_Integer */ // Performance-sensitive: this code is called for every point cloud message - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters normalize = false, forceType?: PointFieldType | NumericType, ): FieldReader | undefined { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointExtensionUtils.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointExtensionUtils.ts index 8f4815bec0..b68ce01606 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointExtensionUtils.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/pointExtensionUtils.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { t } from "i18next"; +import * as THREE from "three"; + import { SettingsTreeNode, Topic } from "@lichtblick/suite"; import { DynamicBufferGeometry } from "@lichtblick/suite-base/panels/ThreeDeeRender/DynamicBufferGeometry"; import { IRenderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; @@ -14,8 +20,6 @@ import { import { BaseSettings } from "@lichtblick/suite-base/panels/ThreeDeeRender/settings"; import { MAX_DURATION } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; import { updatePose } from "@lichtblick/suite-base/panels/ThreeDeeRender/updatePose"; -import { t } from "i18next"; -import * as THREE from "three"; import { LaserScanMaterial } from "./LaserScans"; import { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/PrimitivePool.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/PrimitivePool.ts index 5079d75e8e..1dcc0ae36b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/PrimitivePool.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/PrimitivePool.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableArrows.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableArrows.ts index c05522616f..c5f05db4b6 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableArrows.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableArrows.ts @@ -1,11 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { toNanoSec } from "@foxglove/rostime"; import { ArrowPrimitive, SceneEntity } from "@foxglove/schemas"; +import * as THREE from "three"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCubes.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCubes.ts index c9bfa92d6a..6852797853 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCubes.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCubes.ts @@ -1,11 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { toNanoSec } from "@foxglove/rostime"; import { CubePrimitive, SceneEntity } from "@foxglove/schemas"; +import * as THREE from "three"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCylinders.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCylinders.ts index 996d455fa9..414bbce748 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCylinders.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableCylinders.ts @@ -1,11 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { toNanoSec } from "@foxglove/rostime"; import { CylinderPrimitive, SceneEntity } from "@foxglove/schemas"; +import * as THREE from "three"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts index c2f7bf137b..d69d7fb94d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts @@ -1,8 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LineMaterialWithAlphaVertex } from "@lichtblick/suite-base/panels/ThreeDeeRender/LineMaterialWithAlphaVertex"; +import { toNanoSec } from "@foxglove/rostime"; +import { LinePrimitive, LineType, SceneEntity } from "@foxglove/schemas"; import * as THREE from "three"; import { Line2 } from "three/examples/jsm/lines/Line2"; import { LineGeometry } from "three/examples/jsm/lines/LineGeometry"; @@ -10,8 +14,7 @@ import { LineSegments2 } from "three/examples/jsm/lines/LineSegments2"; import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry"; import { assert } from "ts-essentials"; -import { toNanoSec } from "@foxglove/rostime"; -import { LinePrimitive, LineType, SceneEntity } from "@foxglove/schemas"; +import { LineMaterialWithAlphaVertex } from "@lichtblick/suite-base/panels/ThreeDeeRender/LineMaterialWithAlphaVertex"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts index 2a0b49c9f8..ea05614c63 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts @@ -1,12 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { crc32 } from "@foxglove/crc"; import { toNanoSec } from "@foxglove/rostime"; import { ModelPrimitive, SceneEntity } from "@foxglove/schemas"; +import * as THREE from "three"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderablePrimitive.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderablePrimitive.ts index 80609be564..15a545970f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderablePrimitive.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderablePrimitive.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { SceneEntity } from "@foxglove/schemas"; + import { IRenderer } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; import { BaseUserData, Renderable } from "@lichtblick/suite-base/panels/ThreeDeeRender/Renderable"; import { RosValue } from "@lichtblick/suite-base/players/types"; import { emptyPose } from "@lichtblick/suite-base/util/Pose"; -import { SceneEntity } from "@foxglove/schemas"; - import { LayerSettingsEntity } from "../../settings"; export type EntityRenderableUserData = BaseUserData & { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableSpheres.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableSpheres.ts index 436b413586..1959aa1aea 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableSpheres.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableSpheres.ts @@ -1,11 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import * as THREE from "three"; - import { toNanoSec } from "@foxglove/rostime"; import { SpherePrimitive, SceneEntity } from "@foxglove/schemas"; +import * as THREE from "three"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTexts.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTexts.ts index 272f4c2a11..b2d89bcff4 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTexts.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTexts.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts index c95faa7c8a..a81c5b6603 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { DynamicBufferGeometry } from "@lichtblick/suite-base/panels/ThreeDeeRender/DynamicBufferGeometry"; -import * as THREE from "three"; - import { toNanoSec } from "@foxglove/rostime"; import { Point3, SceneEntity, TriangleListPrimitive } from "@foxglove/schemas"; +import * as THREE from "three"; + +import { DynamicBufferGeometry } from "@lichtblick/suite-base/panels/ThreeDeeRender/DynamicBufferGeometry"; import { RenderablePrimitive } from "./RenderablePrimitive"; import type { IRenderer } from "../../IRenderer"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/types.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/types.ts index f7c114f54d..76878549d6 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/types.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/primitives/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/projections.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/projections.ts index 23bb82caeb..f5de1f83d3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/projections.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/projections.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { PinholeCameraModel } from "@lichtblick/den/image"; - import { CameraCalibration } from "@foxglove/schemas"; +import { PinholeCameraModel } from "@lichtblick/den/image"; + import { PartialMessage } from "../SceneExtension"; import { normalizeHeader, normalizeTime } from "../normalizeMessages"; import { diff --git a/packages/suite-base/src/panels/ThreeDeeRender/renderables/transforms.ts b/packages/suite-base/src/panels/ThreeDeeRender/renderables/transforms.ts index e24dd61bcb..23c706bf44 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/renderables/transforms.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/renderables/transforms.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/ros.ts b/packages/suite-base/src/panels/ThreeDeeRender/ros.ts index 2ac3d0e82c..f9eab1625e 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/ros.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/ros.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/settings.ts b/packages/suite-base/src/panels/ThreeDeeRender/settings.ts index f6e747022f..bc9e02d714 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/settings.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/settings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ArrowMarkers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ArrowMarkers.stories.tsx index 96444841f4..97a8b6aa21 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ArrowMarkers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ArrowMarkers.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { BASE_LINK_FRAME_ID, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/AutoSelectFrame.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/AutoSelectFrame.stories.tsx index ef79696e6a..dbad17dee8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/AutoSelectFrame.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/AutoSelectFrame.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { BASE_LINK_FRAME_ID, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/CameraInfoRender.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/CameraInfoRender.stories.tsx index 29f12dae5d..45fc4b71db 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/CameraInfoRender.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/CameraInfoRender.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { screen, userEvent } from "@storybook/testing-library"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { screen, userEvent } from "@storybook/testing-library"; import { BASE_LINK_FRAME_ID, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ColladaUpAxis.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ColladaUpAxis.stories.tsx index 2cccd6c7c4..e2a350330b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ColladaUpAxis.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ColladaUpAxis.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { COLLADA_CONE_Y_UP_MESH_RESOURCE, COLLADA_CONE_Z_UP_MESH_RESOURCE } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/CustomBackgroundColor.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/CustomBackgroundColor.stories.tsx index 5ccd2fb8d5..d280e75f03 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/CustomBackgroundColor.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/CustomBackgroundColor.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { StoryObj } from "@storybook/react"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; + import useDelayedFixture from "./useDelayedFixture"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/EditableTransform.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/EditableTransform.stories.tsx index 3b2a329ad3..87ab4b2991 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/EditableTransform.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/EditableTransform.stories.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import type { FrameTransform } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { eulerToQuaternion } from "@lichtblick/suite-base/util/geometry"; -import { StoryObj } from "@storybook/react"; - -import type { FrameTransform } from "@foxglove/schemas"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/FramelessMarkers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/FramelessMarkers.stories.tsx index 63207d33da..c58af922c1 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/FramelessMarkers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/FramelessMarkers.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor, rad2deg, TEST_COLORS } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_Polygon.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_Polygon.stories.tsx index cdebb667de..1c5e3dc231 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_Polygon.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_Polygon.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseArray.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseArray.stories.tsx index 72d0d0e35d..0889148a1d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseArray.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseArray.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { quat } from "gl-matrix"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { quat } from "gl-matrix"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseStamped.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseStamped.stories.tsx index bf66091987..9c89d9e12d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseStamped.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/GeometryMsgs_PoseStamped.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { quat } from "gl-matrix"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { quat } from "gl-matrix"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageAnnotations.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageAnnotations.stories.tsx index 9a83f0fba8..d485b80925 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageAnnotations.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageAnnotations.stories.tsx @@ -1,19 +1,22 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ImageAnnotations, PointsAnnotationType } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; +import { screen, userEvent } from "@storybook/testing-library"; +import * as _ from "lodash-es"; +import { useEffect, useState } from "react"; + import { MessageEvent } from "@lichtblick/suite"; import { ImageModeConfig } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; import { makeRawImageAndCalibration } from "@lichtblick/suite-base/panels/ThreeDeeRender/stories/ImageMode/imageCommon"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; import delay from "@lichtblick/suite-base/util/delay"; -import { StoryObj } from "@storybook/react"; -import { screen, userEvent } from "@storybook/testing-library"; -import * as _ from "lodash-es"; -import { useEffect, useState } from "react"; - -import { ImageAnnotations, PointsAnnotationType } from "@foxglove/schemas"; import { ImagePanel } from "../../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageMode.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageMode.stories.tsx index eb8877e416..01c493340a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageMode.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageMode.stories.tsx @@ -1,7 +1,24 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { + CameraCalibration, + CompressedImage, + ImageAnnotations, + PointsAnnotation, + PointsAnnotationType, + RawImage, +} from "@foxglove/schemas"; +import { Meta, StoryObj } from "@storybook/react"; +import { fireEvent, screen, userEvent, waitFor } from "@storybook/testing-library"; +import { useCallback, useMemo, useState } from "react"; +import { useAsync } from "react-use"; +import tinycolor from "tinycolor2"; + import { MessageEvent } from "@lichtblick/suite"; import Stack from "@lichtblick/suite-base/components/Stack"; import { @@ -11,20 +28,6 @@ import { import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import delay from "@lichtblick/suite-base/util/delay"; -import { Meta, StoryObj } from "@storybook/react"; -import { fireEvent, screen, userEvent, waitFor } from "@storybook/testing-library"; -import { useCallback, useMemo, useState } from "react"; -import { useAsync } from "react-use"; -import tinycolor from "tinycolor2"; - -import { - CameraCalibration, - CompressedImage, - ImageAnnotations, - PointsAnnotation, - PointsAnnotationType, - RawImage, -} from "@foxglove/schemas"; import { ImagePanel } from "../../index"; import { CameraInfo, CompressedImage as RosCompressedImage, Image as RosRawImage } from "../../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageOnlyMode.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageOnlyMode.stories.tsx index 8339033a57..17e68fa16b 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageOnlyMode.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImageOnlyMode.stories.tsx @@ -1,17 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { ImageModeConfig } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; -import { makeRawImageAndCalibration } from "@lichtblick/suite-base/panels/ThreeDeeRender/stories/ImageMode/imageCommon"; -import { xyzrpyToPose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { screen, userEvent, within } from "@storybook/testing-library"; -import tinycolor from "tinycolor2"; - import { FrameTransforms, ImageAnnotations, @@ -19,6 +12,16 @@ import { PointsAnnotationType, SceneUpdate, } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; +import { screen, userEvent, within } from "@storybook/testing-library"; +import tinycolor from "tinycolor2"; + +import { MessageEvent } from "@lichtblick/suite"; +import { ImageModeConfig } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; +import { makeRawImageAndCalibration } from "@lichtblick/suite-base/panels/ThreeDeeRender/stories/ImageMode/imageCommon"; +import { xyzrpyToPose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { ImagePanel } from "../../index"; import { QUAT_IDENTITY, makeColor } from "../common"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImagePanZoomRotate.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImagePanZoomRotate.stories.tsx index cc2c5fdb76..5b0c84ba0f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImagePanZoomRotate.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/ImagePanZoomRotate.stories.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { makeRawImageAndCalibration } from "@lichtblick/suite-base/panels/ThreeDeeRender/stories/ImageMode/imageCommon"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import { ImageAnnotations, SceneUpdate } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { fireEvent } from "@storybook/testing-library"; import * as THREE from "three"; -import { ImageAnnotations, SceneUpdate } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { makeRawImageAndCalibration } from "@lichtblick/suite-base/panels/ThreeDeeRender/stories/ImageMode/imageCommon"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { ImagePanel } from "../../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/imageCommon.ts b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/imageCommon.ts index 77970654c8..f1b8dd4cc3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/imageCommon.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageMode/imageCommon.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; - import { CameraCalibration, CompressedImage, RawImage } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; + type MakeImageArgs = { width: number; height: number; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageRender.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageRender.stories.tsx index 3b20d532e9..12b48811d8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageRender.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/ImageRender.stories.tsx @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; +import { CompressedImage, RawImage } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { userEvent, screen } from "@storybook/testing-library"; import { useEffect, useState } from "react"; -import { CompressedImage, RawImage } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; import { PNG_TEST_IMAGE, rad2deg, SENSOR_FRAME_ID } from "./common"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/LabelMarkers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/LabelMarkers.stories.tsx index a62041fbeb..db51250518 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/LabelMarkers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/LabelMarkers.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor, QUAT_IDENTITY, rad2deg, SENSOR_FRAME_ID } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/LargeTransform.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/LargeTransform.stories.tsx index 7ec5e131c8..a28cb5f45d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/LargeTransform.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/LargeTransform.stories.tsx @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { fromSec } from "@foxglove/rostime"; import { makePass, QUAT_IDENTITY, rad2deg, TEST_COLORS } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/MarkerLifetimes.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/MarkerLifetimes.stories.tsx index 940e64cdf4..d781f23c1d 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/MarkerLifetimes.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/MarkerLifetimes.stories.tsx @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { fromSec } from "@foxglove/rostime"; import { makeFail, makePass, QUAT_IDENTITY, rad2deg, TEST_COLORS, VEC3_ZERO } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/Marker_PointCloud2_Alignment.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/Marker_PointCloud2_Alignment.stories.tsx index a4a6ce4ce8..78826ed397 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/Marker_PointCloud2_Alignment.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/Marker_PointCloud2_Alignment.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor, QUAT_IDENTITY, rad2deg, packRvizRgba, VEC3_ZERO } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/Markers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/Markers.stories.tsx index 74d6985c75..26f69807c0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/Markers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/Markers.stories.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { userEvent, screen } from "@storybook/testing-library"; +import { useEffect, useState } from "react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; -import { StoryObj } from "@storybook/react"; -import { userEvent, screen } from "@storybook/testing-library"; -import { useEffect, useState } from "react"; import { makeColor, QUAT_IDENTITY, rad2deg, SENSOR_FRAME_ID } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeasurementTool.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeasurementTool.stories.tsx index 444e8a132b..624c1acb20 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeasurementTool.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeasurementTool.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import delay from "@lichtblick/suite-base/util/delay"; -import { StoryObj } from "@storybook/react"; import { QUAT_IDENTITY, rad2deg } from "./common"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkerOrientation.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkerOrientation.stories.tsx index 59cde9a86e..c57c7c34df 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkerOrientation.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkerOrientation.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { COLLADA_AXES_MESH_RESOURCE, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkers.stories.tsx index 14c0ec3b8d..fdbe850171 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/MeshMarkers.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor, OBJ_CUBE_MESH_RESOURCE, QUAT_IDENTITY, STL_CUBE_MESH_RESOURCE } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/NavMsgs_Path.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/NavMsgs_Path.stories.tsx index edd7bad949..355483ab33 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/NavMsgs_Path.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/NavMsgs_Path.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { quat } from "gl-matrix"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { quat } from "gl-matrix"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/OccupancyGrid.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/OccupancyGrid.stories.tsx index feab920371..d722b9e953 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/OccupancyGrid.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/OccupancyGrid.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { screen, userEvent, waitFor } from "@storybook/testing-library"; + import { MessageEvent } from "@lichtblick/suite"; import { LayerSettingsOccupancyGrid } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/OccupancyGrids"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { screen, userEvent, waitFor } from "@storybook/testing-library"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/PoseMarkers.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/PoseMarkers.stories.tsx index d77d5f05a5..40c902728c 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/PoseMarkers.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/PoseMarkers.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { BASE_LINK_FRAME_ID, diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/PublishClickTool.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/PublishClickTool.stories.tsx index aebf26878e..ab1743a4de 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/PublishClickTool.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/PublishClickTool.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { userEvent, screen } from "@storybook/testing-library"; + import { MessageEvent } from "@lichtblick/suite"; import { PlayerCapabilities, Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import delay from "@lichtblick/suite-base/util/delay"; -import { StoryObj } from "@storybook/react"; -import { userEvent, screen } from "@storybook/testing-library"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/SceneEntities.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/SceneEntities.stories.tsx index 5f63719ef4..5bf03b8c78 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/SceneEntities.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/SceneEntities.stories.tsx @@ -1,13 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { ColorRGBA } from "@lichtblick/suite-base/panels/ThreeDeeRender/ros"; -import { xyzrpyToPose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; +import { FrameTransform, LineType, SceneEntity, SceneUpdate } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { useEffect, useMemo, useState } from "react"; import * as THREE from "three"; @@ -15,7 +13,12 @@ import { STLExporter } from "three/examples/jsm/exporters/STLExporter"; import { TeapotGeometry } from "three/examples/jsm/geometries/TeapotGeometry"; import tinycolor from "tinycolor2"; -import { FrameTransform, LineType, SceneEntity, SceneUpdate } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { ColorRGBA } from "@lichtblick/suite-base/panels/ThreeDeeRender/ros"; +import { xyzrpyToPose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import { useReadySignal } from "@lichtblick/suite-base/stories/ReadySignalContext"; import { makeColor, QUAT_IDENTITY, rad2deg } from "./common"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_LaserScan.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_LaserScan.stories.tsx index 7733a8ea36..695040472a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_LaserScan.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_LaserScan.stories.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import { fromSec } from "@foxglove/rostime"; import { StoryObj } from "@storybook/react"; import * as THREE from "three"; -import { fromSec } from "@foxglove/rostime"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_PointCloud2.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_PointCloud2.stories.tsx index b3b8016896..78b216e751 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_PointCloud2.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/SensorMsgs_PointCloud2.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { vec3 } from "gl-matrix"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; -import { vec3 } from "gl-matrix"; import { packRvizRgba, QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/SphereListPointsTransform.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/SphereListPointsTransform.stories.tsx index 337e173cbe..f8da794b89 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/SphereListPointsTransform.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/SphereListPointsTransform.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; +import { DeepWritable } from "ts-essentials"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { SphereListMarker } from "@lichtblick/suite-base/types/Messages"; -import { StoryObj } from "@storybook/react"; -import { DeepWritable } from "ts-essentials"; import { makeColor, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/TransformInterpolation.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/TransformInterpolation.stories.tsx index d6c36f69b1..1f125e9580 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/TransformInterpolation.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/TransformInterpolation.stories.tsx @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { fromSec } from "@foxglove/rostime"; import { makePass, QUAT_IDENTITY, rad2deg, TEST_COLORS } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/UrdfDisplayMode.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/UrdfDisplayMode.stories.tsx index 06e24daa42..18a3248ee1 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/UrdfDisplayMode.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/UrdfDisplayMode.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor } from "./common"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/Urdfs.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/Urdfs.stories.tsx index 56ab1e20cd..8dcf4f4b25 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/Urdfs.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/Urdfs.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; import { makeColor, STL_CUBE_MESH_RESOURCE } from "./common"; import ThreeDeePanel from "../index"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/VelodyneScan.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/VelodyneScan.stories.tsx index 6a8665923d..b293f99918 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/VelodyneScan.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/VelodyneScan.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { VelodyneScan } from "@lichtblick/suite-base/types/Messages"; -import { StoryObj } from "@storybook/react"; import { rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/common.ts b/packages/suite-base/src/panels/ThreeDeeRender/stories/common.ts index 0cec30a036..09543e18c3 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/common.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/common.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { MessageEvent } from "@lichtblick/suite"; +import type { Time } from "@foxglove/rostime"; import * as base64 from "@protobufjs/base64"; -import type { Time } from "@foxglove/rostime"; +import type { MessageEvent } from "@lichtblick/suite"; import { stringToRgba } from "../color"; import type { ColorRGBA, Marker, Point } from "../ros"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransform.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransform.stories.tsx index 1d0e0db1bf..8a4cc790f6 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransform.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransform.stories.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import type { FrameTransform } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { fromSec } from "@foxglove/rostime"; -import type { FrameTransform } from "@foxglove/schemas"; import { makePass, QUAT_IDENTITY, rad2deg, TEST_COLORS } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransforms.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransforms.stories.tsx index 77a0c0c388..3ef15d72bf 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransforms.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.FrameTransforms.stories.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import { fromSec } from "@foxglove/rostime"; +import type { FrameTransforms } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; -import { fromSec } from "@foxglove/rostime"; -import type { FrameTransforms } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { makePass, QUAT_IDENTITY, rad2deg, TEST_COLORS } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.Grid.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.Grid.stories.tsx index fe59750968..15ad41502f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.Grid.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.Grid.stories.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Grid, NumericType } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; + import { MessageEvent } from "@lichtblick/suite"; import { LayerSettingsFoxgloveGrid } from "@lichtblick/suite-base/panels/ThreeDeeRender/renderables/FoxgloveGrid"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; - -import { Grid, NumericType } from "@foxglove/schemas"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.LaserScan.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.LaserScan.stories.tsx index eba25eb8e1..06f51969c8 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.LaserScan.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.LaserScan.stories.tsx @@ -1,18 +1,21 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import { FrameTransform, LaserScan, PointCloud } from "@foxglove/schemas"; +import { StoryObj } from "@storybook/react"; +import { screen, userEvent } from "@storybook/testing-library"; +import * as THREE from "three"; + import { MessageEvent } from "@lichtblick/suite"; import { xyzrpyToPose } from "@lichtblick/suite-base/panels/ThreeDeeRender/transforms"; import { Topic } from "@lichtblick/suite-base/players/types"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { emptyPose } from "@lichtblick/suite-base/util/Pose"; -import { StoryObj } from "@storybook/react"; -import { screen, userEvent } from "@storybook/testing-library"; -import * as THREE from "three"; - -import { fromSec } from "@foxglove/rostime"; -import { FrameTransform, LaserScan, PointCloud } from "@foxglove/schemas"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PointCloud.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PointCloud.stories.tsx index bf9d99e36f..a586cae679 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PointCloud.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PointCloud.stories.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import type { PointCloud } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { screen, userEvent } from "@storybook/testing-library"; import { vec3 } from "gl-matrix"; -import type { PointCloud } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { QUAT_IDENTITY, rad2deg, VEC3_ZERO } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PoseInFrame.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PoseInFrame.stories.tsx index 72d35bf76b..c0ccf6800e 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PoseInFrame.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PoseInFrame.stories.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import { FrameTransform, PoseInFrame } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { userEvent, screen } from "@storybook/testing-library"; import { quat } from "gl-matrix"; -import { FrameTransform, PoseInFrame } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PosesInFrame.stories.tsx b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PosesInFrame.stories.tsx index 0f185e4777..67cd613c29 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PosesInFrame.stories.tsx +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/foxglove.PosesInFrame.stories.tsx @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent } from "@lichtblick/suite"; -import { Topic } from "@lichtblick/suite-base/players/types"; -import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; +import { FrameTransform, PosesInFrame } from "@foxglove/schemas"; import { StoryObj } from "@storybook/react"; import { userEvent, screen } from "@storybook/testing-library"; import { quat } from "gl-matrix"; -import { FrameTransform, PosesInFrame } from "@foxglove/schemas"; +import { MessageEvent } from "@lichtblick/suite"; +import { Topic } from "@lichtblick/suite-base/players/types"; +import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { QUAT_IDENTITY, rad2deg } from "./common"; import useDelayedFixture from "./useDelayedFixture"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/stories/useDelayedFixture.ts b/packages/suite-base/src/panels/ThreeDeeRender/stories/useDelayedFixture.ts index 35a2bc6d40..90dcf36518 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/stories/useDelayedFixture.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/stories/useDelayedFixture.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; import { useLayoutEffect, useRef, useState } from "react"; +import { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; + // useDelayedFixture works around a contract in useMessageReducer which does not re-process an existing // frame when topics change. // diff --git a/packages/suite-base/src/panels/ThreeDeeRender/t3D.ts b/packages/suite-base/src/panels/ThreeDeeRender/t3D.ts index fcc0dea00d..fbfc030bc5 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/t3D.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/t3D.ts @@ -1,8 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { threeDee } from "@lichtblick/suite-base/i18n/en"; import { t } from "i18next"; +import { threeDee } from "@lichtblick/suite-base/i18n/en"; + export const t3D = (threeDeeKey: keyof typeof threeDee): string => t(`threeDee:${threeDeeKey}`); diff --git a/packages/suite-base/src/panels/ThreeDeeRender/topicIsConvertibleToSchema.ts b/packages/suite-base/src/panels/ThreeDeeRender/topicIsConvertibleToSchema.ts index 6d003f55d3..5ff7f5745f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/topicIsConvertibleToSchema.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/topicIsConvertibleToSchema.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/CoordinateFrame.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/CoordinateFrame.ts index 26cde768a3..d2e1524827 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/CoordinateFrame.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/CoordinateFrame.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -/* eslint-disable @foxglove/no-boolean-parameters */ +/* eslint-disable @lichtblick/no-boolean-parameters */ + +import { mat4, quat, vec3, vec4 } from "gl-matrix"; import { ArrayMap } from "@lichtblick/den/collection"; import { ObjectPool } from "@lichtblick/den/collection/ObjectPool"; -import { mat4, quat, vec3, vec4 } from "gl-matrix"; import { Transform } from "./Transform"; import { Pose, mat4Identity } from "./geometry"; diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/Transform.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/Transform.ts index 3e342a2388..132e0e5a8f 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/Transform.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/Transform.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.test.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.test.ts index 44a065baa4..442fd74b74 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.test.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts index 8fdf52b70b..844bee71fc 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/geometry.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/geometry.ts index 2fbdc87fb6..8eeb88f121 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/geometry.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/geometry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/index.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/index.ts index f7be281da7..cf29d9a4e1 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/index.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/transforms/time.ts b/packages/suite-base/src/panels/ThreeDeeRender/transforms/time.ts index 3a4a118aeb..f88206db1e 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/transforms/time.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/transforms/time.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/types.ts b/packages/suite-base/src/panels/ThreeDeeRender/types.ts index bbd6f04e9a..11ec80fcb0 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/types.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/ThreeDeeRender/updatePose.ts b/packages/suite-base/src/panels/ThreeDeeRender/updatePose.ts index 2a91263b3c..80e202666a 100644 --- a/packages/suite-base/src/panels/ThreeDeeRender/updatePose.ts +++ b/packages/suite-base/src/panels/ThreeDeeRender/updatePose.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/TopicGraph/Graph.tsx b/packages/suite-base/src/panels/TopicGraph/Graph.tsx index 2e2687a832..67d272363f 100644 --- a/packages/suite-base/src/panels/TopicGraph/Graph.tsx +++ b/packages/suite-base/src/panels/TopicGraph/Graph.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/TopicGraph/index.stories.tsx b/packages/suite-base/src/panels/TopicGraph/index.stories.tsx index 336f2877ad..33317f6a91 100644 --- a/packages/suite-base/src/panels/TopicGraph/index.stories.tsx +++ b/packages/suite-base/src/panels/TopicGraph/index.stories.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import delay from "@lichtblick/suite-base/util/delay"; import { StoryObj } from "@storybook/react"; import { useEffect, useState } from "react"; import { useAsync } from "react-use"; +import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; +import delay from "@lichtblick/suite-base/util/delay"; + import TopicGraph, { TopicVisibility } from "./index"; export default { diff --git a/packages/suite-base/src/panels/TopicGraph/index.tsx b/packages/suite-base/src/panels/TopicGraph/index.tsx index 4868b0ae8b..1332ef2081 100644 --- a/packages/suite-base/src/panels/TopicGraph/index.tsx +++ b/packages/suite-base/src/panels/TopicGraph/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -17,13 +20,6 @@ import { Diamond20Filled, RectangleLandscape20Regular, } from "@fluentui/react-icons"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import ExpandingToolbar, { ToolGroup } from "@lichtblick/suite-base/components/ExpandingToolbar"; -import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; -import Panel from "@lichtblick/suite-base/components/Panel"; -import PanelToolbar, { - PANEL_TOOLBAR_MIN_HEIGHT, -} from "@lichtblick/suite-base/components/PanelToolbar"; import { FormControlLabel, IconButton, @@ -37,6 +33,14 @@ import { useCallback, useMemo, useRef, useState } from "react"; import textMetrics from "text-metrics"; import { makeStyles } from "tss-react/mui"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import ExpandingToolbar, { ToolGroup } from "@lichtblick/suite-base/components/ExpandingToolbar"; +import { useMessagePipeline } from "@lichtblick/suite-base/components/MessagePipeline"; +import Panel from "@lichtblick/suite-base/components/Panel"; +import PanelToolbar, { + PANEL_TOOLBAR_MIN_HEIGHT, +} from "@lichtblick/suite-base/components/PanelToolbar"; + import Graph, { GraphMutation } from "./Graph"; const LABEL_MAX_WIDTH = 200; diff --git a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/DiagnosticsSection.tsx b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/DiagnosticsSection.tsx index 3cf9e54729..570603a05d 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/DiagnosticsSection.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/DiagnosticsSection.tsx @@ -1,12 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { - Diagnostic, - DiagnosticSeverity, -} from "@lichtblick/suite-base/players/UserScriptPlayer/types"; import ErrorIcon from "@mui/icons-material/Error"; import HelpIcon from "@mui/icons-material/Help"; import InfoIcon from "@mui/icons-material/Info"; @@ -16,6 +14,12 @@ import * as _ from "lodash-es"; import { ReactElement } from "react"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { + Diagnostic, + DiagnosticSeverity, +} from "@lichtblick/suite-base/players/UserScriptPlayer/types"; + const severityIcons = { Hint: , Info: , diff --git a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/LogsSection.tsx b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/LogsSection.tsx index 8b2b0b1ac8..d508309c7c 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/LogsSection.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/LogsSection.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { UserScriptLog } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; -import { useJsonTreeTheme } from "@lichtblick/suite-base/util/globalConstants"; import { Link, List, ListItem, ListItemButton, ListItemText, Typography } from "@mui/material"; import { useEffect, useRef, useState } from "react"; import Tree from "react-json-tree"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { UserScriptLog } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; +import { useJsonTreeTheme } from "@lichtblick/suite-base/util/globalConstants"; + const useStyles = makeStyles()({ list: { height: "100%", diff --git a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/index.tsx b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/index.tsx index 92b8e94220..b04269104c 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/BottomBar/index.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/BottomBar/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,6 +15,10 @@ // You may not use this file except in compliance with the License. // +import { Badge, Button, Divider, Paper, Tab, Tabs, badgeClasses, tabClasses } from "@mui/material"; +import { ReactElement, useState } from "react"; +import { makeStyles } from "tss-react/mui"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { UserScriptStore, @@ -20,9 +27,6 @@ import { import DiagnosticsSection from "@lichtblick/suite-base/panels/UserScriptEditor/BottomBar/DiagnosticsSection"; import LogsSection from "@lichtblick/suite-base/panels/UserScriptEditor/BottomBar/LogsSection"; import { Diagnostic, UserScriptLog } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; -import { Badge, Button, Divider, Paper, Tab, Tabs, badgeClasses, tabClasses } from "@mui/material"; -import { ReactElement, useState } from "react"; -import { makeStyles } from "tss-react/mui"; type Props = { diagnostics: readonly Diagnostic[]; diff --git a/packages/suite-base/src/panels/UserScriptEditor/Config.ts b/packages/suite-base/src/panels/UserScriptEditor/Config.ts index 9d718579b6..b36933975c 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Config.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/Config.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/Editor.tsx b/packages/suite-base/src/panels/UserScriptEditor/Editor.tsx index a40875a619..0484007c7b 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Editor.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Editor.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import getPrettifiedCode from "@lichtblick/suite-base/panels/UserScriptEditor/getPrettifiedCode"; -import { Script } from "@lichtblick/suite-base/panels/UserScriptEditor/script"; -import { getUserScriptProjectConfig } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/projectConfig"; -import inScreenshotTests from "@lichtblick/suite-base/stories/inScreenshotTests"; -import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; -import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; import { useTheme } from "@mui/material"; // @ts-expect-error ICodeEditorService does not have type information in the monaco-editor package import { ICodeEditorService } from "monaco-editor/esm/vs/editor/browser/services/codeEditorService"; @@ -30,6 +27,13 @@ import { useResizeDetector } from "react-resize-detector"; import { useLatest } from "react-use"; import { ModuleResolutionKind } from "typescript"; +import getPrettifiedCode from "@lichtblick/suite-base/panels/UserScriptEditor/getPrettifiedCode"; +import { Script } from "@lichtblick/suite-base/panels/UserScriptEditor/script"; +import { getUserScriptProjectConfig } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/projectConfig"; +import inScreenshotTests from "@lichtblick/suite-base/stories/inScreenshotTests"; +import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; +import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; + import { themes } from "./theme"; const codeEditorService = StandaloneServices.get(ICodeEditorService); diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptListItem.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptListItem.tsx index c60cdbe090..38e92b3c04 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptListItem.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptListItem.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptsList.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptsList.tsx index 7ec0f3d177..e00f411a40 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptsList.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/ScriptsList.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Stack from "@lichtblick/suite-base/components/Stack"; -import { UserScript, UserScripts } from "@lichtblick/suite-base/types/panels"; import AddIcon from "@mui/icons-material/Add"; import { Button, List } from "@mui/material"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { UserScript, UserScripts } from "@lichtblick/suite-base/types/panels"; + import { ScriptListItem } from "./ScriptListItem"; import { SidebarHeader } from "./SidebarHeader"; diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/SidebarHeader.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/SidebarHeader.tsx index 58fe1ba427..563ae8a507 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/SidebarHeader.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/SidebarHeader.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Templates.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Templates.tsx index 4a3c08a4b3..0960643de9 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Templates.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Templates.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { List, ListItem, ListItemButton, ListItemText } from "@mui/material"; + import Stack from "@lichtblick/suite-base/components/Stack"; import templates from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/templates"; -import { List, ListItem, ListItemButton, ListItemText } from "@mui/material"; import { SidebarHeader } from "./SidebarHeader"; diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Utilities.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Utilities.tsx index 890f0ccce4..658932f446 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Utilities.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/Utilities.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { List, ListItem, ListItemButton, ListItemText } from "@mui/material"; + import Stack from "@lichtblick/suite-base/components/Stack"; import { Script } from "@lichtblick/suite-base/panels/UserScriptEditor/script"; import { getUserScriptProjectConfig } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/projectConfig"; -import { List, ListItem, ListItemButton, ListItemText } from "@mui/material"; import { SidebarHeader } from "./SidebarHeader"; diff --git a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/index.tsx b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/index.tsx index c7209f649a..261db0cc20 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/Sidebar/index.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/Sidebar/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -7,15 +10,16 @@ import { Script24Regular, Toolbox24Regular, } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { Script } from "@lichtblick/suite-base/panels/UserScriptEditor/script"; -import { UserScript, UserScripts } from "@lichtblick/suite-base/types/panels"; import { Divider, Paper, Tab, Tabs, tabClasses, tabsClasses } from "@mui/material"; import * as monacoApi from "monaco-editor/esm/vs/editor/editor.api"; import { SyntheticEvent, useCallback, useMemo, useState } from "react"; import tc from "tinycolor2"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { Script } from "@lichtblick/suite-base/panels/UserScriptEditor/script"; +import { UserScript, UserScripts } from "@lichtblick/suite-base/types/panels"; + import { ScriptsList } from "./ScriptsList"; import { Templates } from "./Templates"; import { Utilities } from "./Utilities"; diff --git a/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.test.ts b/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.test.ts index f0e55f766c..39b36ddff8 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.test.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.ts b/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.ts index 6e6597dad8..2f13533f76 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/getPrettifiedCode.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/index.stories.tsx b/packages/suite-base/src/panels/UserScriptEditor/index.stories.tsx index 5e429c83cc..4eb62630a2 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/index.stories.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; +import { fireEvent, screen } from "@storybook/testing-library"; +import { useCallback, useEffect } from "react"; + import { useCurrentLayoutActions } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import NodePlayground from "@lichtblick/suite-base/panels/UserScriptEditor"; import { generateFoxgloveSchemaDeclarations } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/projectConfig"; @@ -19,9 +26,6 @@ import { UserScriptLog } from "@lichtblick/suite-base/players/UserScriptPlayer/t import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; import { ExpectedResult } from "@lichtblick/suite-base/stories/storyHelpers"; import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; -import { StoryObj } from "@storybook/react"; -import { fireEvent, screen } from "@storybook/testing-library"; -import { useCallback, useEffect } from "react"; const userScripts = { nodeId1: { name: "/studio_script/script", sourceCode: "const someVariableName = 1;" }, diff --git a/packages/suite-base/src/panels/UserScriptEditor/index.tsx b/packages/suite-base/src/panels/UserScriptEditor/index.tsx index 0b02b21756..1f33f9336e 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/index.tsx +++ b/packages/suite-base/src/panels/UserScriptEditor/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,24 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import Panel from "@lichtblick/suite-base/components/Panel"; -import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { - LayoutState, - useCurrentLayoutActions, - useCurrentLayoutSelector, -} from "@lichtblick/suite-base/context/CurrentLayoutContext"; -import { - UserScriptStore, - useUserScriptState, -} from "@lichtblick/suite-base/context/UserScriptStateContext"; -import BottomBar from "@lichtblick/suite-base/panels/UserScriptEditor/BottomBar"; -import { Sidebar } from "@lichtblick/suite-base/panels/UserScriptEditor/Sidebar"; -import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { SaveConfig, UserScripts } from "@lichtblick/suite-base/types/panels"; import AddIcon from "@mui/icons-material/Add"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import { @@ -51,6 +36,25 @@ import tc from "tinycolor2"; import { makeStyles } from "tss-react/mui"; import { v4 as uuidv4 } from "uuid"; +import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import Panel from "@lichtblick/suite-base/components/Panel"; +import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { + LayoutState, + useCurrentLayoutActions, + useCurrentLayoutSelector, +} from "@lichtblick/suite-base/context/CurrentLayoutContext"; +import { + UserScriptStore, + useUserScriptState, +} from "@lichtblick/suite-base/context/UserScriptStateContext"; +import BottomBar from "@lichtblick/suite-base/panels/UserScriptEditor/BottomBar"; +import { Sidebar } from "@lichtblick/suite-base/panels/UserScriptEditor/Sidebar"; +import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { SaveConfig, UserScripts } from "@lichtblick/suite-base/types/panels"; + import Config from "./Config"; import { Script } from "./script"; diff --git a/packages/suite-base/src/panels/UserScriptEditor/script.ts b/packages/suite-base/src/panels/UserScriptEditor/script.ts index 4f9d79ff28..f8f39fa327 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/script.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/script.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/theme/index.ts b/packages/suite-base/src/panels/UserScriptEditor/theme/index.ts index b7c4452449..d1acbc96d3 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/theme/index.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/theme/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-dark.ts b/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-dark.ts index e95bccb91f..89875d9967 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-dark.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-dark.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-light.ts b/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-light.ts index 13e6040f48..1d447a74f7 100644 --- a/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-light.ts +++ b/packages/suite-base/src/panels/UserScriptEditor/theme/vs-studio-light.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/VariableSlider/index.stories.tsx b/packages/suite-base/src/panels/VariableSlider/index.stories.tsx index e67bcb472a..9c6326dd40 100644 --- a/packages/suite-base/src/panels/VariableSlider/index.stories.tsx +++ b/packages/suite-base/src/panels/VariableSlider/index.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { StoryObj } from "@storybook/react"; + import VariableSliderPanel from "@lichtblick/suite-base/panels/VariableSlider/index"; import PanelSetup from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; const fixture = { topics: [], diff --git a/packages/suite-base/src/panels/VariableSlider/index.tsx b/packages/suite-base/src/panels/VariableSlider/index.tsx index cf7c564c98..6ea8dc8fc1 100644 --- a/packages/suite-base/src/panels/VariableSlider/index.tsx +++ b/packages/suite-base/src/panels/VariableSlider/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,14 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Slider, Typography, useTheme } from "@mui/material"; +import { useCallback, useState } from "react"; +import { useDebouncedCallback } from "use-debounce"; + import Panel from "@lichtblick/suite-base/components/Panel"; import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; import Stack from "@lichtblick/suite-base/components/Stack"; import useGlobalVariables from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { Slider, Typography, useTheme } from "@mui/material"; -import { useCallback, useState } from "react"; -import { useDebouncedCallback } from "use-debounce"; import { useVariableSliderSettings } from "./settings"; import { VariableSliderConfig } from "./types"; diff --git a/packages/suite-base/src/panels/VariableSlider/settings.ts b/packages/suite-base/src/panels/VariableSlider/settings.ts index bc17d87f80..0a0aa53267 100644 --- a/packages/suite-base/src/panels/VariableSlider/settings.ts +++ b/packages/suite-base/src/panels/VariableSlider/settings.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; -import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; import { produce } from "immer"; import * as _ from "lodash-es"; import { useCallback, useEffect } from "react"; +import { SettingsTreeAction, SettingsTreeNodes } from "@lichtblick/suite"; +import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; + import { VariableSliderConfig } from "./types"; function buildSettingsTree(config: VariableSliderConfig): SettingsTreeNodes { diff --git a/packages/suite-base/src/panels/VariableSlider/types.ts b/packages/suite-base/src/panels/VariableSlider/types.ts index fcc308ce43..dde680c8c8 100644 --- a/packages/suite-base/src/panels/VariableSlider/types.ts +++ b/packages/suite-base/src/panels/VariableSlider/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/createSyncRoot.test.tsx b/packages/suite-base/src/panels/createSyncRoot.test.tsx index f304c4ee07..f3f4188e58 100644 --- a/packages/suite-base/src/panels/createSyncRoot.test.tsx +++ b/packages/suite-base/src/panels/createSyncRoot.test.tsx @@ -1,10 +1,14 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; import { screen } from "@testing-library/react"; +import { createSyncRoot } from "@lichtblick/suite-base/panels/createSyncRoot"; + describe("createSyncRoot", () => { const originalError = console.error; diff --git a/packages/suite-base/src/panels/createSyncRoot.tsx b/packages/suite-base/src/panels/createSyncRoot.tsx index ccc08888f5..e7fd83ec4d 100644 --- a/packages/suite-base/src/panels/createSyncRoot.tsx +++ b/packages/suite-base/src/panels/createSyncRoot.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/diagnostics/DiagnosticStatus.tsx b/packages/suite-base/src/panels/diagnostics/DiagnosticStatus.tsx index a14f54a6fd..a2214beebb 100644 --- a/packages/suite-base/src/panels/diagnostics/DiagnosticStatus.tsx +++ b/packages/suite-base/src/panels/diagnostics/DiagnosticStatus.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Stack from "@lichtblick/suite-base/components/Stack"; -import { openSiblingPlotPanel } from "@lichtblick/suite-base/panels/Plot/openSiblingPlotPanel"; -import { openSiblingStateTransitionsPanel } from "@lichtblick/suite-base/panels/StateTransitions/openSiblingStateTransitionsPanel"; -import { OpenSiblingPanel } from "@lichtblick/suite-base/types/panels"; import PowerInputIcon from "@mui/icons-material/PowerInput"; import ShowChartIcon from "@mui/icons-material/ShowChart"; import { @@ -34,6 +33,11 @@ import { createSelector } from "reselect"; import sanitizeHtml from "sanitize-html"; import { makeStyles } from "tss-react/mui"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { openSiblingPlotPanel } from "@lichtblick/suite-base/panels/Plot/openSiblingPlotPanel"; +import { openSiblingStateTransitionsPanel } from "@lichtblick/suite-base/panels/StateTransitions/openSiblingStateTransitionsPanel"; +import { OpenSiblingPanel } from "@lichtblick/suite-base/types/panels"; + import { DiagnosticInfo, KeyValue, DiagnosticStatusMessage, LEVELS } from "./util"; const MIN_SPLIT_FRACTION = 0.1; diff --git a/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.stories.tsx b/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.stories.tsx index 4182849e04..26d6de96a1 100644 --- a/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.stories.tsx +++ b/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.stories.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import DiagnosticStatusPanel from "@lichtblick/suite-base/panels/diagnostics/DiagnosticStatusPanel"; import { makeDiagnosticMessage } from "@lichtblick/suite-base/panels/diagnostics/DiagnosticSummary.stories"; import { LEVELS } from "@lichtblick/suite-base/panels/diagnostics/util"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; export default { title: "panels/diagnostics/DiagnosticStatusPanel", diff --git a/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.tsx b/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.tsx index 36f5dffd55..4d55e8570b 100644 --- a/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.tsx +++ b/packages/suite-base/src/panels/diagnostics/DiagnosticStatusPanel.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,13 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { compare } from "@foxglove/rostime"; +import { Autocomplete, TextField } from "@mui/material"; +import { produce } from "immer"; +import * as _ from "lodash-es"; +import { useCallback, useEffect, useMemo } from "react"; +import { makeStyles } from "tss-react/mui"; + import { SettingsTreeAction } from "@lichtblick/suite"; import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; import EmptyState from "@lichtblick/suite-base/components/EmptyState"; @@ -21,13 +31,6 @@ import Stack from "@lichtblick/suite-base/components/Stack"; import useStaleTime from "@lichtblick/suite-base/panels/diagnostics/useStaleTime"; import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { Autocomplete, TextField } from "@mui/material"; -import { produce } from "immer"; -import * as _ from "lodash-es"; -import { useCallback, useEffect, useMemo } from "react"; -import { makeStyles } from "tss-react/mui"; - -import { compare } from "@foxglove/rostime"; import DiagnosticStatus from "./DiagnosticStatus"; import { buildStatusPanelSettingsTree } from "./settings"; diff --git a/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.stories.tsx b/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.stories.tsx index a6a21274ff..c6a9a70e57 100644 --- a/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.stories.tsx +++ b/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.stories.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StoryObj } from "@storybook/react"; + import DiagnosticSummary from "@lichtblick/suite-base/panels/diagnostics/DiagnosticSummary"; import { DiagnosticStatusArrayMsg, @@ -11,7 +16,6 @@ import { } from "@lichtblick/suite-base/panels/diagnostics/util"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; import PanelSetup, { Fixture } from "@lichtblick/suite-base/stories/PanelSetup"; -import { StoryObj } from "@storybook/react"; export default { title: "panels/diagnostics/DiagnosticSummary", diff --git a/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.tsx b/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.tsx index 2c88e7ca9d..3f5c48eeac 100644 --- a/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.tsx +++ b/packages/suite-base/src/panels/diagnostics/DiagnosticSummary.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,19 +14,6 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { filterMap } from "@lichtblick/den/collection"; -import { SettingsTreeAction } from "@lichtblick/suite"; -import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; -import EmptyState from "@lichtblick/suite-base/components/EmptyState"; -import Panel from "@lichtblick/suite-base/components/Panel"; -import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; -import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import useDiagnostics from "@lichtblick/suite-base/panels/diagnostics/useDiagnostics"; -import useStaleTime from "@lichtblick/suite-base/panels/diagnostics/useStaleTime"; -import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; -import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import toggle from "@lichtblick/suite-base/util/toggle"; import PushPinIcon from "@mui/icons-material/PushPin"; import { IconButton, @@ -46,6 +36,20 @@ import { AutoSizer } from "react-virtualized"; import { FixedSizeList as List } from "react-window"; import { makeStyles } from "tss-react/mui"; +import { filterMap } from "@lichtblick/den/collection"; +import { SettingsTreeAction } from "@lichtblick/suite"; +import { useDataSourceInfo } from "@lichtblick/suite-base/PanelAPI"; +import EmptyState from "@lichtblick/suite-base/components/EmptyState"; +import Panel from "@lichtblick/suite-base/components/Panel"; +import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; +import PanelToolbar from "@lichtblick/suite-base/components/PanelToolbar"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import useDiagnostics from "@lichtblick/suite-base/panels/diagnostics/useDiagnostics"; +import useStaleTime from "@lichtblick/suite-base/panels/diagnostics/useStaleTime"; +import { usePanelSettingsTreeUpdate } from "@lichtblick/suite-base/providers/PanelStateContextProvider"; +import { SaveConfig } from "@lichtblick/suite-base/types/panels"; +import toggle from "@lichtblick/suite-base/util/toggle"; + import { buildSummarySettingsTree } from "./settings"; import { DEFAULT_SECONDS_UNTIL_STALE, diff --git a/packages/suite-base/src/panels/diagnostics/settings.ts b/packages/suite-base/src/panels/diagnostics/settings.ts index 5083b14c02..49a398b2a4 100644 --- a/packages/suite-base/src/panels/diagnostics/settings.ts +++ b/packages/suite-base/src/panels/diagnostics/settings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/diagnostics/useAvailableDiagnostics.ts b/packages/suite-base/src/panels/diagnostics/useAvailableDiagnostics.ts index 2915cf5e15..787c99ce8e 100644 --- a/packages/suite-base/src/panels/diagnostics/useAvailableDiagnostics.ts +++ b/packages/suite-base/src/panels/diagnostics/useAvailableDiagnostics.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo } from "react"; + import { useMessageReducer } from "@lichtblick/suite-base/PanelAPI"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; -import { useMemo } from "react"; import { DiagnosticStatusArrayMsg } from "./util"; diff --git a/packages/suite-base/src/panels/diagnostics/useDiagnostics.test.ts b/packages/suite-base/src/panels/diagnostics/useDiagnostics.test.ts index 853648e594..5cd3785413 100644 --- a/packages/suite-base/src/panels/diagnostics/useDiagnostics.test.ts +++ b/packages/suite-base/src/panels/diagnostics/useDiagnostics.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/diagnostics/useDiagnostics.ts b/packages/suite-base/src/panels/diagnostics/useDiagnostics.ts index 48a8e47be7..e86a72610c 100644 --- a/packages/suite-base/src/panels/diagnostics/useDiagnostics.ts +++ b/packages/suite-base/src/panels/diagnostics/useDiagnostics.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useMemo } from "react"; + import { useMessageReducer } from "@lichtblick/suite-base/PanelAPI"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; -import { useMemo } from "react"; import { DiagnosticStatusArrayMsg, DiagnosticsById, computeDiagnosticInfo } from "./util"; diff --git a/packages/suite-base/src/panels/diagnostics/useStaleTime.ts b/packages/suite-base/src/panels/diagnostics/useStaleTime.ts index 3e5eeea9e1..6cb644a746 100644 --- a/packages/suite-base/src/panels/diagnostics/useStaleTime.ts +++ b/packages/suite-base/src/panels/diagnostics/useStaleTime.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, clampTime, subtract } from "@foxglove/rostime"; +import { useCallback, useEffect, useMemo, useState } from "react"; + import { MessagePipelineContext, useMessagePipeline, useMessagePipelineGetter, } from "@lichtblick/suite-base/components/MessagePipeline"; -import { useCallback, useEffect, useMemo, useState } from "react"; - -import { Time, clampTime, subtract } from "@foxglove/rostime"; const DEFAULT_UPDATE_INTERVAL_MS = 1_000; diff --git a/packages/suite-base/src/panels/diagnostics/util.test.ts b/packages/suite-base/src/panels/diagnostics/util.test.ts index 5282fcfb45..ac6b337b8f 100644 --- a/packages/suite-base/src/panels/diagnostics/util.test.ts +++ b/packages/suite-base/src/panels/diagnostics/util.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/panels/diagnostics/util.ts b/packages/suite-base/src/panels/diagnostics/util.ts index c2a2782ca3..5b4a1b82e3 100644 --- a/packages/suite-base/src/panels/diagnostics/util.ts +++ b/packages/suite-base/src/panels/diagnostics/util.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { Header } from "@lichtblick/suite-base/types/Messages"; -import fuzzyFilter from "@lichtblick/suite-base/util/fuzzyFilter"; +import { Time, compare } from "@foxglove/rostime"; import * as _ from "lodash-es"; -import { Time, compare } from "@foxglove/rostime"; +import { Header } from "@lichtblick/suite-base/types/Messages"; +import fuzzyFilter from "@lichtblick/suite-base/util/fuzzyFilter"; // Trim the message if it's too long. We sometimes get crazy massive messages here that can // otherwise crash our entire UI. I looked at a bunch of messages manually and they are typically diff --git a/packages/suite-base/src/panels/index.ts b/packages/suite-base/src/panels/index.ts index f908c5eff1..3ee4ae0fd9 100644 --- a/packages/suite-base/src/panels/index.ts +++ b/packages/suite-base/src/panels/index.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { TFunction } from "i18next"; + import { PanelInfo } from "@lichtblick/suite-base/context/PanelCatalogContext"; import { TAB_PANEL_TYPE } from "@lichtblick/suite-base/util/globalConstants"; -import { TFunction } from "i18next"; import dataSourceInfoThumbnail from "./DataSourceInfo/thumbnail.png"; import gaugeThumbnail from "./Gauge/thumbnail.png"; diff --git a/packages/suite-base/src/players/AnalyticsMetricsCollector.ts b/packages/suite-base/src/players/AnalyticsMetricsCollector.ts index 35b2114f00..82ffd8613f 100644 --- a/packages/suite-base/src/players/AnalyticsMetricsCollector.ts +++ b/packages/suite-base/src/players/AnalyticsMetricsCollector.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/JsonMessageWriter.ts b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/JsonMessageWriter.ts index 858009a248..17f4f580a8 100644 --- a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/JsonMessageWriter.ts +++ b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/JsonMessageWriter.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/MessageWriter.ts b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/MessageWriter.ts index e23f6ac7be..2362bf177e 100644 --- a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/MessageWriter.ts +++ b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/MessageWriter.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/WorkerSocketAdapter.ts b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/WorkerSocketAdapter.ts index d8440ebdc3..0906795694 100644 --- a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/WorkerSocketAdapter.ts +++ b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/WorkerSocketAdapter.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/index.ts b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/index.ts index 545caca7e6..e1b723d54b 100644 --- a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/index.ts +++ b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/index.ts @@ -1,32 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { debouncePromise } from "@lichtblick/den/async"; -import Log from "@lichtblick/log"; -import { ParameterValue } from "@lichtblick/suite"; -import { Asset } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; -import PlayerProblemManager from "@lichtblick/suite-base/players/PlayerProblemManager"; -import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; -import { - AdvertiseOptions, - MessageEvent, - Player, - PlayerCapabilities, - PlayerMetricsCollectorInterface, - PlayerPresence, - PlayerProblem, - PlayerState, - PublishPayload, - SubscribePayload, - Topic, - TopicStats, -} from "@lichtblick/suite-base/players/types"; -import rosDatatypesToMessageDefinition from "@lichtblick/suite-base/util/rosDatatypesToMessageDefinition"; -import * as base64 from "@protobufjs/base64"; -import * as _ from "lodash-es"; -import { v4 as uuidv4 } from "uuid"; - import { parseChannel, ParsedChannel } from "@foxglove/mcap-support"; import { MessageDefinition, isMsgDefEqual } from "@foxglove/message-definition"; import CommonRosTypes from "@foxglove/rosmsg-msgs-common"; @@ -50,6 +28,31 @@ import { FetchAssetResponse, BinaryOpcode, } from "@foxglove/ws-protocol"; +import * as base64 from "@protobufjs/base64"; +import * as _ from "lodash-es"; +import { v4 as uuidv4 } from "uuid"; + +import { debouncePromise } from "@lichtblick/den/async"; +import Log from "@lichtblick/log"; +import { ParameterValue } from "@lichtblick/suite"; +import { Asset } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; +import PlayerProblemManager from "@lichtblick/suite-base/players/PlayerProblemManager"; +import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; +import { + AdvertiseOptions, + MessageEvent, + Player, + PlayerCapabilities, + PlayerMetricsCollectorInterface, + PlayerPresence, + PlayerProblem, + PlayerState, + PublishPayload, + SubscribePayload, + Topic, + TopicStats, +} from "@lichtblick/suite-base/players/types"; +import rosDatatypesToMessageDefinition from "@lichtblick/suite-base/util/rosDatatypesToMessageDefinition"; import { JsonMessageWriter } from "./JsonMessageWriter"; import { MessageWriter } from "./MessageWriter"; diff --git a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/worker.ts b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/worker.ts index 38820ee342..8001864dcb 100644 --- a/packages/suite-base/src/players/FoxgloveWebSocketPlayer/worker.ts +++ b/packages/suite-base/src/players/FoxgloveWebSocketPlayer/worker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/BagIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/BagIterableSource.ts index 6f0fc14def..255fbd6607 100644 --- a/packages/suite-base/src/players/IterablePlayer/BagIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/BagIterableSource.ts @@ -1,7 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Bag, Filelike } from "@foxglove/rosbag"; +import { BlobReader } from "@foxglove/rosbag/web"; +import { parse as parseMessageDefinition } from "@foxglove/rosmsg"; +import { MessageReader } from "@foxglove/rosmsg-serialization"; +import { compare } from "@foxglove/rostime"; +import Bzip2 from "@foxglove/wasm-bz2"; +import decompressLZ4 from "@foxglove/wasm-lz4"; + import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; import { MessageEvent, @@ -14,14 +25,6 @@ import BrowserHttpReader from "@lichtblick/suite-base/util/BrowserHttpReader"; import CachedFilelike from "@lichtblick/suite-base/util/CachedFilelike"; import { getBagChunksOverlapCount } from "@lichtblick/suite-base/util/bags"; -import { Bag, Filelike } from "@foxglove/rosbag"; -import { BlobReader } from "@foxglove/rosbag/web"; -import { parse as parseMessageDefinition } from "@foxglove/rosmsg"; -import { MessageReader } from "@foxglove/rosmsg-serialization"; -import { compare } from "@foxglove/rostime"; -import Bzip2 from "@foxglove/wasm-bz2"; -import decompressLZ4 from "@foxglove/wasm-lz4"; - import { GetBackfillMessagesArgs, IIterableSource, diff --git a/packages/suite-base/src/players/IterablePlayer/BagIterableSourceWorker.worker.ts b/packages/suite-base/src/players/IterablePlayer/BagIterableSourceWorker.worker.ts index f81faad1b9..43ee0e4aeb 100644 --- a/packages/suite-base/src/players/IterablePlayer/BagIterableSourceWorker.worker.ts +++ b/packages/suite-base/src/players/IterablePlayer/BagIterableSourceWorker.worker.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as Comlink from "comlink"; + import { IterableSourceInitializeArgs } from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; import { WorkerIterableSourceWorker } from "@lichtblick/suite-base/players/IterablePlayer/WorkerIterableSourceWorker"; -import * as Comlink from "comlink"; import { BagIterableSource } from "./BagIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/BlockLoader.test.ts b/packages/suite-base/src/players/IterablePlayer/BlockLoader.test.ts index f74cd5e560..820c4a1f6c 100644 --- a/packages/suite-base/src/players/IterablePlayer/BlockLoader.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/BlockLoader.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/BlockLoader.ts b/packages/suite-base/src/players/IterablePlayer/BlockLoader.ts index 815924e7b3..43d3f9a878 100644 --- a/packages/suite-base/src/players/IterablePlayer/BlockLoader.ts +++ b/packages/suite-base/src/players/IterablePlayer/BlockLoader.ts @@ -1,17 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Condvar } from "@lichtblick/den/async"; -import { filterMap } from "@lichtblick/den/collection"; -import Log from "@lichtblick/log"; -import { Immutable, MessageEvent } from "@lichtblick/suite"; -import { IteratorCursor } from "@lichtblick/suite-base/players/IterablePlayer/IteratorCursor"; -import PlayerProblemManager from "@lichtblick/suite-base/players/PlayerProblemManager"; -import { MessageBlock, Progress, TopicSelection } from "@lichtblick/suite-base/players/types"; -import { simplify } from "intervals-fn"; -import * as _ from "lodash-es"; - import { Time, add, @@ -20,6 +13,16 @@ import { subtract as subtractTimes, toNanoSec, } from "@foxglove/rostime"; +import { simplify } from "intervals-fn"; +import * as _ from "lodash-es"; + +import { Condvar } from "@lichtblick/den/async"; +import { filterMap } from "@lichtblick/den/collection"; +import Log from "@lichtblick/log"; +import { Immutable, MessageEvent } from "@lichtblick/suite"; +import { IteratorCursor } from "@lichtblick/suite-base/players/IterablePlayer/IteratorCursor"; +import PlayerProblemManager from "@lichtblick/suite-base/players/PlayerProblemManager"; +import { MessageBlock, Progress, TopicSelection } from "@lichtblick/suite-base/players/types"; import { IIterableSource, MessageIteratorArgs } from "./IIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.test.ts b/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.test.ts index 556b25b3c2..e812e7fb81 100644 --- a/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.test.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; + import { MessageEvent } from "@lichtblick/suite"; import { mockTopicSelection } from "@lichtblick/suite-base/test/mocks/mockTopicSelection"; -import * as _ from "lodash-es"; import { BufferedIterableSource } from "./BufferedIterableSource"; import { diff --git a/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.ts index 1a53372b57..07e460e546 100644 --- a/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/BufferedIterableSource.ts @@ -1,15 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { add as addTime, compare, clampTime } from "@foxglove/rostime"; +import EventEmitter from "eventemitter3"; + import { Condvar } from "@lichtblick/den/async"; import { VecQueue } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; import { Time, MessageEvent } from "@lichtblick/suite"; import { Range } from "@lichtblick/suite-base/util/ranges"; -import EventEmitter from "eventemitter3"; - -import { add as addTime, compare, clampTime } from "@foxglove/rostime"; import { CachingIterableSource } from "./CachingIterableSource"; import { diff --git a/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.test.ts b/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.test.ts index c0d66c2be0..a1b13425ad 100644 --- a/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.ts index e74e6df640..e4c298c0b4 100644 --- a/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/CachingIterableSource.ts @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { add, compare, subtract, toNanoSec } from "@foxglove/rostime"; +import EventEmitter from "eventemitter3"; +import * as _ from "lodash-es"; + import { minIndexBy, sortedIndexByTuple } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; import { MessageEvent, Time } from "@lichtblick/suite"; import { TopicSelection } from "@lichtblick/suite-base/players/types"; import { Range } from "@lichtblick/suite-base/util/ranges"; -import EventEmitter from "eventemitter3"; -import * as _ from "lodash-es"; - -import { add, compare, subtract, toNanoSec } from "@foxglove/rostime"; import { GetBackfillMessagesArgs, diff --git a/packages/suite-base/src/players/IterablePlayer/IIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/IIterableSource.ts index 143b606c73..25f6a98cf7 100644 --- a/packages/suite-base/src/players/IterablePlayer/IIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/IIterableSource.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; + import { Immutable, MessageEvent, Metadata } from "@lichtblick/suite"; import { PlayerProblem, @@ -11,8 +16,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { Time } from "@foxglove/rostime"; - export type Initalization = { start: Time; end: Time; diff --git a/packages/suite-base/src/players/IterablePlayer/IterablePlayer.test.ts b/packages/suite-base/src/players/IterablePlayer/IterablePlayer.test.ts index 0d7c124cc7..75597949b9 100644 --- a/packages/suite-base/src/players/IterablePlayer/IterablePlayer.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/IterablePlayer.test.ts @@ -1,8 +1,14 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { fromSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; + import { signal } from "@lichtblick/den/async"; import { MessageEvent, @@ -11,9 +17,6 @@ import { PlayerState, } from "@lichtblick/suite-base/players/types"; import { mockTopicSelection } from "@lichtblick/suite-base/test/mocks/mockTopicSelection"; -import * as _ from "lodash-es"; - -import { fromSec } from "@foxglove/rostime"; import { GetBackfillMessagesArgs, diff --git a/packages/suite-base/src/players/IterablePlayer/IterablePlayer.ts b/packages/suite-base/src/players/IterablePlayer/IterablePlayer.ts index f55f3498c9..4a54226bd5 100644 --- a/packages/suite-base/src/players/IterablePlayer/IterablePlayer.ts +++ b/packages/suite-base/src/players/IterablePlayer/IterablePlayer.ts @@ -1,7 +1,24 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { + Time, + add, + clampTime, + compare, + fromMillis, + fromNanoSec, + toRFC3339String, + toString, +} from "@foxglove/rostime"; +import assert from "assert"; +import * as _ from "lodash-es"; +import { v4 as uuidv4 } from "uuid"; + import { debouncePromise } from "@lichtblick/den/async"; import { filterMap } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; @@ -26,20 +43,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import delay from "@lichtblick/suite-base/util/delay"; -import assert from "assert"; -import * as _ from "lodash-es"; -import { v4 as uuidv4 } from "uuid"; - -import { - Time, - add, - clampTime, - compare, - fromMillis, - fromNanoSec, - toRFC3339String, - toString, -} from "@foxglove/rostime"; import { BlockLoader } from "./BlockLoader"; import { BufferedIterableSource } from "./BufferedIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/IteratorCursor.ts b/packages/suite-base/src/players/IterablePlayer/IteratorCursor.ts index 97a970f483..5ef1a807b8 100644 --- a/packages/suite-base/src/players/IterablePlayer/IteratorCursor.ts +++ b/packages/suite-base/src/players/IterablePlayer/IteratorCursor.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Time } from "@lichtblick/suite"; - import { compare, add as addTime } from "@foxglove/rostime"; +import { Time } from "@lichtblick/suite"; + import type { IMessageCursor, IteratorResult } from "./IIterableSource"; const TIME_ZERO = Object.freeze({ sec: 0, nsec: 0 }); diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/BlobReadable.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/BlobReadable.ts index 20fad10cba..8290cf3f75 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/BlobReadable.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/BlobReadable.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.test.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.test.ts index 25f706d180..430690cb7c 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.test.ts @@ -1,13 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { BlobReadable } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/BlobReadable"; -import { McapIndexedIterableSource } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/McapIndexedIterableSource"; +import { loadDecompressHandlers } from "@foxglove/mcap-support"; import { McapIndexedReader, McapWriter, TempBuffer } from "@mcap/core"; import { Blob } from "node:buffer"; -import { loadDecompressHandlers } from "@foxglove/mcap-support"; +import { BlobReadable } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/BlobReadable"; +import { McapIndexedIterableSource } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/McapIndexedIterableSource"; describe("McapIndexedIterableSource", () => { it("returns the correct metadata", async () => { diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.ts index 0eb363fb40..7303abfe03 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIndexedIterableSource.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ParsedChannel, parseChannel } from "@foxglove/mcap-support"; +import { Time, fromNanoSec, toNanoSec, compare } from "@foxglove/rostime"; +import { McapIndexedReader, McapTypes } from "@mcap/core"; + import { pickFields } from "@lichtblick/den/records"; import Logger from "@lichtblick/log"; import { MessageEvent, Metadata } from "@lichtblick/suite"; @@ -20,10 +27,6 @@ import { TopicStats, } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { McapIndexedReader, McapTypes } from "@mcap/core"; - -import { ParsedChannel, parseChannel } from "@foxglove/mcap-support"; -import { Time, fromNanoSec, toNanoSec, compare } from "@foxglove/rostime"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.test.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.test.ts index 5bfb42d764..6388918445 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.test.ts @@ -1,12 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { TempBuffer } from "@foxglove/mcap-support"; import { McapWriter } from "@mcap/core"; import { Blob } from "node:buffer"; -import { TempBuffer } from "@foxglove/mcap-support"; - import { McapIterableSource } from "./McapIterableSource"; describe("McapIterableSource", () => { diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.ts index 1db022233d..0d1d75345e 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSource.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; -import { MessageEvent } from "@lichtblick/suite-base/players/types"; +import { loadDecompressHandlers } from "@foxglove/mcap-support"; import { McapIndexedReader, McapTypes } from "@mcap/core"; -import { loadDecompressHandlers } from "@foxglove/mcap-support"; +import Log from "@lichtblick/log"; +import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { BlobReadable } from "./BlobReadable"; import { McapIndexedIterableSource } from "./McapIndexedIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSourceWorker.worker.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSourceWorker.worker.ts index a3e908a216..97c3861d53 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSourceWorker.worker.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapIterableSourceWorker.worker.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as Comlink from "comlink"; + import { IterableSourceInitializeArgs } from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; import { WorkerIterableSourceWorker } from "@lichtblick/suite-base/players/IterablePlayer/WorkerIterableSourceWorker"; -import * as Comlink from "comlink"; import { McapIterableSource } from "./McapIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.test.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.test.ts index 55ad26f6d2..08f11e423f 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.test.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { McapUnindexedIterableSource } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/McapUnindexedIterableSource"; import { McapWriter, TempBuffer } from "@mcap/core"; import { Blob } from "node:buffer"; +import { McapUnindexedIterableSource } from "@lichtblick/suite-base/players/IterablePlayer/Mcap/McapUnindexedIterableSource"; + describe("McapUnindexedIterableSource", () => { it("returns the correct metadata", async () => { const tempBuffer = new TempBuffer(); diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.ts index 1ff3269956..eddd5ac7cc 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/McapUnindexedIterableSource.ts @@ -1,21 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { MessageEvent, Metadata } from "@lichtblick/suite"; -import { - GetBackfillMessagesArgs, - IIterableSource, - Initalization, - IteratorResult, - MessageIteratorArgs, -} from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; -import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; -import { PlayerProblem, Topic, TopicStats } from "@lichtblick/suite-base/players/types"; -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { McapStreamReader, McapTypes } from "@mcap/core"; -import * as _ from "lodash-es"; - import { loadDecompressHandlers, parseChannel, ParsedChannel } from "@foxglove/mcap-support"; import { Time, @@ -28,6 +17,20 @@ import { toRFC3339String, compare, } from "@foxglove/rostime"; +import { McapStreamReader, McapTypes } from "@mcap/core"; +import * as _ from "lodash-es"; + +import { MessageEvent, Metadata } from "@lichtblick/suite"; +import { + GetBackfillMessagesArgs, + IIterableSource, + Initalization, + IteratorResult, + MessageIteratorArgs, +} from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; +import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; +import { PlayerProblem, Topic, TopicStats } from "@lichtblick/suite-base/players/types"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; const DURATION_YEAR_SEC = 365 * 24 * 60 * 60; diff --git a/packages/suite-base/src/players/IterablePlayer/Mcap/RemoteFileReadable.ts b/packages/suite-base/src/players/IterablePlayer/Mcap/RemoteFileReadable.ts index 17ad387ea7..7113aca5df 100644 --- a/packages/suite-base/src/players/IterablePlayer/Mcap/RemoteFileReadable.ts +++ b/packages/suite-base/src/players/IterablePlayer/Mcap/RemoteFileReadable.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/WorkerIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/WorkerIterableSource.ts index 26118d259f..5970f470e9 100644 --- a/packages/suite-base/src/players/IterablePlayer/WorkerIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/WorkerIterableSource.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { ComlinkWrap } from "@lichtblick/den/worker"; -import { Immutable, MessageEvent, Time } from "@lichtblick/suite"; +import { abortSignalTransferHandler } from "@foxglove/comlink-transfer-handlers"; import * as Comlink from "comlink"; -import { abortSignalTransferHandler } from "@foxglove/comlink-transfer-handlers"; +import { ComlinkWrap } from "@lichtblick/den/worker"; +import { Immutable, MessageEvent, Time } from "@lichtblick/suite"; import type { GetBackfillMessagesArgs, diff --git a/packages/suite-base/src/players/IterablePlayer/WorkerIterableSourceWorker.ts b/packages/suite-base/src/players/IterablePlayer/WorkerIterableSourceWorker.ts index eff1b7324a..9cb26fa5ba 100644 --- a/packages/suite-base/src/players/IterablePlayer/WorkerIterableSourceWorker.ts +++ b/packages/suite-base/src/players/IterablePlayer/WorkerIterableSourceWorker.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { Immutable, MessageEvent } from "@lichtblick/suite"; +import { abortSignalTransferHandler } from "@foxglove/comlink-transfer-handlers"; import * as Comlink from "comlink"; -import { abortSignalTransferHandler } from "@foxglove/comlink-transfer-handlers"; +import { Immutable, MessageEvent } from "@lichtblick/suite"; import type { GetBackfillMessagesArgs, diff --git a/packages/suite-base/src/players/IterablePlayer/freezeMetadata.test.ts b/packages/suite-base/src/players/IterablePlayer/freezeMetadata.test.ts index e829d953aa..36487c5f61 100644 --- a/packages/suite-base/src/players/IterablePlayer/freezeMetadata.test.ts +++ b/packages/suite-base/src/players/IterablePlayer/freezeMetadata.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/freezeMetadata.ts b/packages/suite-base/src/players/IterablePlayer/freezeMetadata.ts index 457bd7d384..783f36af67 100644 --- a/packages/suite-base/src/players/IterablePlayer/freezeMetadata.ts +++ b/packages/suite-base/src/players/IterablePlayer/freezeMetadata.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/index.ts b/packages/suite-base/src/players/IterablePlayer/index.ts index fa12fe7243..b28912d48f 100644 --- a/packages/suite-base/src/players/IterablePlayer/index.ts +++ b/packages/suite-base/src/players/IterablePlayer/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSource.ts b/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSource.ts index d8a1b1b518..040d691e34 100644 --- a/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSource.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ROS2_TO_DEFINITIONS, Rosbag2, SqliteSqljs } from "@foxglove/rosbag2-web"; +import { stringify } from "@foxglove/rosmsg"; +import { Time, add as addTime } from "@foxglove/rostime"; + import { MessageEvent } from "@lichtblick/suite"; import { estimateObjectSize } from "@lichtblick/suite-base/players/messageMemoryEstimation"; import { @@ -14,10 +21,6 @@ import { import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { basicDatatypes } from "@lichtblick/suite-base/util/basicDatatypes"; -import { ROS2_TO_DEFINITIONS, Rosbag2, SqliteSqljs } from "@foxglove/rosbag2-web"; -import { stringify } from "@foxglove/rosmsg"; -import { Time, add as addTime } from "@foxglove/rostime"; - import { GetBackfillMessagesArgs, IIterableSource, diff --git a/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSourceWorker.worker.ts b/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSourceWorker.worker.ts index 5e895aeb3f..d99ffd1c73 100644 --- a/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSourceWorker.worker.ts +++ b/packages/suite-base/src/players/IterablePlayer/rosdb3/RosDb3IterableSourceWorker.worker.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as Comlink from "comlink"; + import { IterableSourceInitializeArgs } from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; import { WorkerIterableSourceWorker } from "@lichtblick/suite-base/players/IterablePlayer/WorkerIterableSourceWorker"; -import * as Comlink from "comlink"; import { RosDb3IterableSource } from "./RosDb3IterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSource.ts b/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSource.ts index 89a5ac91a7..0f719c44de 100644 --- a/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSource.ts +++ b/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSource.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ros1 } from "@foxglove/rosmsg-msgs-common"; +import { Time, fromMicros, isTimeInRangeInclusive, toMicroSec } from "@foxglove/rostime"; +import { MessageType, ULog } from "@foxglove/ulog"; +import { BlobReader } from "@foxglove/ulog/web"; + import Logger from "@lichtblick/log"; import { MessageEvent, ParameterValue } from "@lichtblick/suite"; import { @@ -13,11 +21,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { ros1 } from "@foxglove/rosmsg-msgs-common"; -import { Time, fromMicros, isTimeInRangeInclusive, toMicroSec } from "@foxglove/rostime"; -import { MessageType, ULog } from "@foxglove/ulog"; -import { BlobReader } from "@foxglove/ulog/web"; - import { messageIdToTopic, messageDefinitionToRos, logLevelToRosout } from "./support"; import { IIterableSource, diff --git a/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSourceWorker.worker.ts b/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSourceWorker.worker.ts index babcafbb52..47c748cd55 100644 --- a/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSourceWorker.worker.ts +++ b/packages/suite-base/src/players/IterablePlayer/ulog/UlogIterableSourceWorker.worker.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as Comlink from "comlink"; + import { IterableSourceInitializeArgs } from "@lichtblick/suite-base/players/IterablePlayer/IIterableSource"; import { WorkerIterableSourceWorker } from "@lichtblick/suite-base/players/IterablePlayer/WorkerIterableSourceWorker"; -import * as Comlink from "comlink"; import { UlogIterableSource } from "./UlogIterableSource"; diff --git a/packages/suite-base/src/players/IterablePlayer/ulog/support.ts b/packages/suite-base/src/players/IterablePlayer/ulog/support.ts index b71d463fc4..2295865f0e 100644 --- a/packages/suite-base/src/players/IterablePlayer/ulog/support.ts +++ b/packages/suite-base/src/players/IterablePlayer/ulog/support.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/NoopMetricsCollector.ts b/packages/suite-base/src/players/NoopMetricsCollector.ts index d624a36950..e842b1b0b9 100644 --- a/packages/suite-base/src/players/NoopMetricsCollector.ts +++ b/packages/suite-base/src/players/NoopMetricsCollector.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/PlayerProblemManager.test.ts b/packages/suite-base/src/players/PlayerProblemManager.test.ts index 2f2d63f25d..c748e8f52b 100644 --- a/packages/suite-base/src/players/PlayerProblemManager.test.ts +++ b/packages/suite-base/src/players/PlayerProblemManager.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/PlayerProblemManager.ts b/packages/suite-base/src/players/PlayerProblemManager.ts index b021612f03..87aa5d0327 100644 --- a/packages/suite-base/src/players/PlayerProblemManager.ts +++ b/packages/suite-base/src/players/PlayerProblemManager.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/Ros1Player.ts b/packages/suite-base/src/players/Ros1Player.ts index 49681f25d5..3a1b49b315 100644 --- a/packages/suite-base/src/players/Ros1Player.ts +++ b/packages/suite-base/src/players/Ros1Player.ts @@ -1,7 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Sockets } from "@foxglove/electron-socket/renderer"; +import { MessageDefinition } from "@foxglove/message-definition"; +import { RosNode, TcpSocket } from "@foxglove/ros1"; +import { Time, fromMillis, isGreaterThan, toSec } from "@foxglove/rostime"; +import { HttpServer } from "@foxglove/xmlrpc"; +import * as _ from "lodash-es"; +import { v4 as uuidv4 } from "uuid"; + import { debouncePromise } from "@lichtblick/den/async"; import Logger from "@lichtblick/log"; import { ParameterValue } from "@lichtblick/suite"; @@ -24,14 +35,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import rosDatatypesToMessageDefinition from "@lichtblick/suite-base/util/rosDatatypesToMessageDefinition"; -import * as _ from "lodash-es"; -import { v4 as uuidv4 } from "uuid"; - -import { Sockets } from "@foxglove/electron-socket/renderer"; -import { MessageDefinition } from "@foxglove/message-definition"; -import { RosNode, TcpSocket } from "@foxglove/ros1"; -import { Time, fromMillis, isGreaterThan, toSec } from "@foxglove/rostime"; -import { HttpServer } from "@foxglove/xmlrpc"; const log = Logger.getLogger(__filename); const rosLog = Logger.getLogger("ROS1"); @@ -432,7 +435,7 @@ export default class Ros1Player implements Player { sizeInBytes: number, schemaName: string, // This is a hot path so we avoid extra object allocation from a parameters struct - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters external: boolean, ): void => { if (this.#providerTopics == undefined) { diff --git a/packages/suite-base/src/players/RosbridgePlayer.test.ts b/packages/suite-base/src/players/RosbridgePlayer.test.ts index d9f724e86c..eef842da12 100644 --- a/packages/suite-base/src/players/RosbridgePlayer.test.ts +++ b/packages/suite-base/src/players/RosbridgePlayer.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,12 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Time } from "@foxglove/rostime"; + import { signal } from "@lichtblick/den/async"; import NoopMetricsCollector from "@lichtblick/suite-base/players/NoopMetricsCollector"; import RosbridgePlayer from "@lichtblick/suite-base/players/RosbridgePlayer"; -import { Time } from "@foxglove/rostime"; - const headerMessage = ({ seq, stamp: { sec, nsec }, diff --git a/packages/suite-base/src/players/RosbridgePlayer.ts b/packages/suite-base/src/players/RosbridgePlayer.ts index 07820ec2af..eeb7112979 100644 --- a/packages/suite-base/src/players/RosbridgePlayer.ts +++ b/packages/suite-base/src/players/RosbridgePlayer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import roslib from "@foxglove/roslibjs"; +import { parse as parseMessageDefinition } from "@foxglove/rosmsg"; +import { MessageReader as ROS1MessageReader } from "@foxglove/rosmsg-serialization"; +import { MessageReader as ROS2MessageReader } from "@foxglove/rosmsg2-serialization"; +import { Time, fromMillis, toSec } from "@foxglove/rostime"; +import * as _ from "lodash-es"; +import { v4 as uuidv4 } from "uuid"; + import { debouncePromise } from "@lichtblick/den/async"; import { filterMap } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; @@ -32,14 +43,6 @@ import { } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { bagConnectionsToDatatypes } from "@lichtblick/suite-base/util/bagConnectionsHelper"; -import * as _ from "lodash-es"; -import { v4 as uuidv4 } from "uuid"; - -import roslib from "@foxglove/roslibjs"; -import { parse as parseMessageDefinition } from "@foxglove/rosmsg"; -import { MessageReader as ROS1MessageReader } from "@foxglove/rosmsg-serialization"; -import { MessageReader as ROS2MessageReader } from "@foxglove/rosmsg2-serialization"; -import { Time, fromMillis, toSec } from "@foxglove/rostime"; const log = Log.getLogger(__dirname); diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.test.ts b/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.test.ts index cb161e1980..f13800bc74 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.test.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.ts b/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.ts index cb6d1d0053..d116feb54e 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/AliasingStateProcessor.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import memoizeWeak from "memoize-weak"; + import { Immutable as Im, MessageEvent } from "@lichtblick/suite"; import { MessageBlock, @@ -12,8 +18,6 @@ import { Topic, TopicStats, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; -import memoizeWeak from "memoize-weak"; import { BlockTopicProcessor } from "./BlockTopicProcessor"; import { IStateProcessor } from "./IStateProcessor"; diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/BlockTopicProcessor.ts b/packages/suite-base/src/players/TopicAliasingPlayer/BlockTopicProcessor.ts index e5ac0b388a..af2dc89e33 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/BlockTopicProcessor.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/BlockTopicProcessor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/IStateProcessor.ts b/packages/suite-base/src/players/TopicAliasingPlayer/IStateProcessor.ts index a6fe4a884f..def8993921 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/IStateProcessor.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/IStateProcessor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/NoopStateProcessor.ts b/packages/suite-base/src/players/TopicAliasingPlayer/NoopStateProcessor.ts index 2e26ffe175..dcf086b7b8 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/NoopStateProcessor.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/NoopStateProcessor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.test.ts b/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.test.ts index 2af6aff3cd..591a925c72 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.test.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.ts b/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.ts index 7ec8079704..e3600c0c03 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/StateProcessorFactory.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; + import { TopicAliasFunction, Immutable as Im } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { PlayerProblem, Topic } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; import { AliasingStateProcessor, TopicAliasMap } from "./AliasingStateProcessor"; import { IStateProcessor } from "./IStateProcessor"; diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.test.ts b/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.test.ts index 193abc59ff..9e549f2e4a 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.test.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.ts b/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.ts index d03c8c7c72..2fee947282 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/TopicAliasingPlayer.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time } from "@foxglove/rostime"; +import * as _ from "lodash-es"; + import { MutexLocked } from "@lichtblick/den/async"; import { Immutable, Metadata, ParameterValue } from "@lichtblick/suite"; import { Asset } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; @@ -13,9 +19,6 @@ import { PublishPayload, SubscribePayload, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; - -import { Time } from "@foxglove/rostime"; import { IStateProcessor } from "./IStateProcessor"; import { NoopStateProcessor } from "./NoopStateProcessor"; diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.test.ts b/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.test.ts index 55718ae441..85a7bc6eb4 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.test.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.ts b/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.ts index 42fd10910f..ab2a8e1617 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/aliasing.ts @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import memoizeWeak from "memoize-weak"; + import { TopicAliasFunction, Immutable as Im, MessageEvent } from "@lichtblick/suite"; import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { @@ -13,8 +19,6 @@ import { Topic, TopicStats, } from "@lichtblick/suite-base/players/types"; -import * as _ from "lodash-es"; -import memoizeWeak from "memoize-weak"; type TopicAliasMap = Map; type MessageBlocks = readonly (undefined | MessageBlock)[]; diff --git a/packages/suite-base/src/players/TopicAliasingPlayer/mocks.ts b/packages/suite-base/src/players/TopicAliasingPlayer/mocks.ts index 2d61609082..b10581f39f 100644 --- a/packages/suite-base/src/players/TopicAliasingPlayer/mocks.ts +++ b/packages/suite-base/src/players/TopicAliasingPlayer/mocks.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/MemoizedLibGenerator.ts b/packages/suite-base/src/players/UserScriptPlayer/MemoizedLibGenerator.ts index c6fd031226..05d0f61b43 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/MemoizedLibGenerator.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/MemoizedLibGenerator.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/MockUserScriptPlayerWorker.ts b/packages/suite-base/src/players/UserScriptPlayer/MockUserScriptPlayerWorker.ts index 9745b09976..5564b41842 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/MockUserScriptPlayerWorker.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/MockUserScriptPlayerWorker.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Rpc, { Channel, createLinkedChannels } from "@lichtblick/suite-base/util/Rpc"; import * as _ from "lodash-es"; +import Rpc, { Channel, createLinkedChannels } from "@lichtblick/suite-base/util/Rpc"; + import { processMessage, registerScript } from "./runtimeWorker/registry"; import generateRosLib from "./transformerWorker/generateRosLib"; import transform from "./transformerWorker/transform"; diff --git a/packages/suite-base/src/players/UserScriptPlayer/index.test.ts b/packages/suite-base/src/players/UserScriptPlayer/index.test.ts index 41cd87fb72..bbea4bab99 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/index.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/index.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/index.ts b/packages/suite-base/src/players/UserScriptPlayer/index.ts index ee66233ff4..ecbc145ad8 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/index.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,14 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { Time, compare } from "@foxglove/rostime"; +import { Mutex } from "async-mutex"; +import * as _ from "lodash-es"; +import memoizeWeak from "memoize-weak"; +import ReactDOM from "react-dom"; +import shallowequal from "shallowequal"; +import { v4 as uuidv4 } from "uuid"; + import { MutexLocked } from "@lichtblick/den/async"; import { filterMap } from "@lichtblick/den/collection"; import Log from "@lichtblick/log"; @@ -53,14 +64,6 @@ import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { UserScript, UserScripts } from "@lichtblick/suite-base/types/panels"; import Rpc from "@lichtblick/suite-base/util/Rpc"; import { basicDatatypes } from "@lichtblick/suite-base/util/basicDatatypes"; -import { Mutex } from "async-mutex"; -import * as _ from "lodash-es"; -import memoizeWeak from "memoize-weak"; -import ReactDOM from "react-dom"; -import shallowequal from "shallowequal"; -import { v4 as uuidv4 } from "uuid"; - -import { Time, compare } from "@foxglove/rostime"; import { remapVirtualSubscriptions, getPreloadTypes } from "./subscriptions"; diff --git a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/index.ts b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/index.ts index 61bfaba5ba..668e9eabd0 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/index.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.test.ts b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.test.ts index e8172518b5..c95f16d40d 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.ts b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.ts index e23aae79c3..6feafcc9ed 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/runtimeWorker/registry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import path from "path"; + import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { Diagnostic, @@ -22,7 +27,6 @@ import { UserScriptLog, } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; -import path from "path"; // Each script runtime worker runs one script at a time, hence why we have one // global declaration of 'nodeCallback'. diff --git a/packages/suite-base/src/players/UserScriptPlayer/subscriptions.test.ts b/packages/suite-base/src/players/UserScriptPlayer/subscriptions.test.ts index e90aca383a..813ccfe396 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/subscriptions.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/subscriptions.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/subscriptions.ts b/packages/suite-base/src/players/UserScriptPlayer/subscriptions.ts index 47f52b39f5..a7de1e6c7b 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/subscriptions.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/subscriptions.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as R from "ramda"; + import { Immutable } from "@lichtblick/suite"; import { mergeSubscriptions } from "@lichtblick/suite-base/components/MessagePipeline/subscriptions"; import { SubscribePayload } from "@lichtblick/suite-base/players/types"; -import * as R from "ramda"; // A mapping from the subscription to the input topics needed to satisfy // that request. diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/fixtures/example-datatypes.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/fixtures/example-datatypes.ts index b723bb8d4b..d91c1be356 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/fixtures/example-datatypes.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/fixtures/example-datatypes.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.test.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.test.ts index 8d2102cd0a..a733019f67 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import ts from "typescript/lib/typescript"; + import stressTestDatatypes from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/fixtures/example-datatypes"; import generateRosLib, { generateTypeDefs, @@ -20,7 +25,6 @@ import generateRosLib, { import { compile } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/transform"; import { ScriptData } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; import { Topic } from "@lichtblick/suite-base/players/types"; -import ts from "typescript/lib/typescript"; const baseNodeData: ScriptData = { name: "/studio_script/main", diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.ts index ec9e9f2d3f..de3acdd441 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateRosLib.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import ts from "typescript/lib/typescript"; + import { filterMap } from "@lichtblick/den/collection"; import { Topic } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import ts from "typescript/lib/typescript"; export type InterfaceDeclarations = { [datatype: string]: ts.InterfaceDeclaration; diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.test.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.test.ts index beaec7ca54..d9858496ab 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.ts index 8bc2344075..7519269291 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/generateTypesLib.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/index.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/index.ts index 0719edd271..caff7443f5 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/index.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.test.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.test.ts index d5d9af1879..cf4e6216fb 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.test.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.ts index 8e6a4f8294..508f2b1ae1 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/transform.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import ts from "typescript/lib/typescript"; + import { filterMap } from "@lichtblick/den/collection"; import { formatInterfaceName } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/generateRosLib"; import { @@ -34,7 +39,6 @@ import { } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; import { Topic } from "@lichtblick/suite-base/players/types"; import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; -import ts from "typescript/lib/typescript"; import { TransformArgs } from "./types"; import generatedTypesLibSrc from "./typescript/userUtils/generatedTypes.ts?raw"; diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/types.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/types.ts index 1092079ba4..ef5464476a 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/types.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ast.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ast.ts index 92dfbc5f3f..b8e00f3b61 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ast.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ast.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { MessageDefinitionField } from "@foxglove/message-definition"; +import ts from "typescript/lib/typescript"; + import { noFuncError, nonFuncError, @@ -34,9 +40,6 @@ import { Diagnostic, } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; import type { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import ts from "typescript/lib/typescript"; - -import { MessageDefinitionField } from "@foxglove/message-definition"; type TypeParam = { parent?: TypeParam; @@ -318,9 +321,9 @@ export const constructDatatypes = ( const getRosMsgField = ( name: string, tsNode: ts.Node, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters isArray: boolean = false, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters isComplex: boolean = false, typeMap: TypeMap = {}, innerDepth: number = 1, diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/errors.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/errors.ts index 3e398a4b10..a25343b194 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/errors.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/errors.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/lib.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/lib.ts index 2a9e9850bc..c694e9bb2a 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/lib.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/lib.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/projectConfig.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/projectConfig.ts index cf184347f3..b554623cca 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/projectConfig.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/projectConfig.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { exportTypeScriptSchemas } from "@foxglove/schemas/internal"; +import * as _ from "lodash-es"; + import { lib_dts, lib_filename, @@ -25,9 +31,6 @@ import { UserScriptProjectFile, } from "@lichtblick/suite-base/players/UserScriptPlayer/transformerWorker/typescript/types"; import { DEFAULT_STUDIO_SCRIPT_PREFIX } from "@lichtblick/suite-base/util/globalConstants"; -import * as _ from "lodash-es"; - -import { exportTypeScriptSchemas } from "@foxglove/schemas/internal"; /** * Generates virtual ts files for each type exported by the @foxglove/schemas package. diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/rawUserUtils.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/rawUserUtils.ts index afa5ecb105..fd68e42fad 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/rawUserUtils.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/rawUserUtils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ros.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ros.ts index ccd2142a30..8d800d80c0 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ros.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/ros.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/templates/index.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/templates/index.ts index a43bfa2f17..3efe4598e3 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/templates/index.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/templates/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/types.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/types.ts index 1c0aafc285..caf54f0a00 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/types.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/.eslintrc.yaml b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/.eslintrc.yaml index a4a642cb60..23d65250df 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/.eslintrc.yaml +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/.eslintrc.yaml @@ -1,3 +1,3 @@ rules: # do not require license header for userUtils - "@foxglove/license-header": off + "@lichtblick/license-header": off diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/pointClouds.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/pointClouds.ts index d8ab4f5dcf..8cf6bc7620 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/pointClouds.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/typescript/userUtils/pointClouds.ts @@ -70,7 +70,7 @@ export function setRayDistance(pt: Point, distance: number): Point { }; } -// eslint-disable-next-line @foxglove/no-boolean-parameters +// eslint-disable-next-line @lichtblick/no-boolean-parameters export function convertToRangeView(points: Point[], range: number, makeColors: boolean): RGBA[] { const colors: RGBA[] = makeColors ? new Array(points.length) : []; // First pass to get min and max ranges diff --git a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/utils.ts b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/utils.ts index 969c540602..6a96bc2ba3 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/utils.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/transformerWorker/utils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,12 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import ts from "typescript/lib/typescript"; + import { DiagnosticSeverity, Diagnostic, } from "@lichtblick/suite-base/players/UserScriptPlayer/types"; -import ts from "typescript/lib/typescript"; const mapCategoryToDiagnosticSeverity = ( category: ts.DiagnosticCategory, diff --git a/packages/suite-base/src/players/UserScriptPlayer/types.ts b/packages/suite-base/src/players/UserScriptPlayer/types.ts index 7bcc431ff6..0f17f11201 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/types.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import type { SourceFile, TypeChecker } from "typescript"; + import { GlobalVariables } from "@lichtblick/suite-base/hooks/useGlobalVariables"; import { MessageEvent, Topic } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import type { SourceFile, TypeChecker } from "typescript"; // make sure to use import type to avoid bringing in the actual implementations to the bundle diff --git a/packages/suite-base/src/players/UserScriptPlayer/utils.ts b/packages/suite-base/src/players/UserScriptPlayer/utils.ts index 9a39deb672..7ec7aad1c9 100644 --- a/packages/suite-base/src/players/UserScriptPlayer/utils.ts +++ b/packages/suite-base/src/players/UserScriptPlayer/utils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/VelodynePlayer.ts b/packages/suite-base/src/players/VelodynePlayer.ts index a0479b7380..72e2938e09 100644 --- a/packages/suite-base/src/players/VelodynePlayer.ts +++ b/packages/suite-base/src/players/VelodynePlayer.ts @@ -1,7 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Sockets, UdpRemoteInfo, UdpSocketRenderer } from "@foxglove/electron-socket/renderer"; +import { Time, fromMillis, add as addTimes, toDate, fromDate, fromMicros } from "@foxglove/rostime"; +import { Model, RawPacket, ReturnMode, packetRate } from "@foxglove/velodyne-cloud"; +import { v4 as uuidv4 } from "uuid"; + import { debouncePromise } from "@lichtblick/den/async"; import Logger from "@lichtblick/log"; import { ParameterValue } from "@lichtblick/suite"; @@ -20,11 +28,6 @@ import { TopicStats, } from "@lichtblick/suite-base/players/types"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; -import { v4 as uuidv4 } from "uuid"; - -import { Sockets, UdpRemoteInfo, UdpSocketRenderer } from "@foxglove/electron-socket/renderer"; -import { Time, fromMillis, add as addTimes, toDate, fromDate, fromMicros } from "@foxglove/rostime"; -import { Model, RawPacket, ReturnMode, packetRate } from "@foxglove/velodyne-cloud"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/players/messageMemoryEstimation.test.ts b/packages/suite-base/src/players/messageMemoryEstimation.test.ts index 6b51ed38cf..71e85ae063 100644 --- a/packages/suite-base/src/players/messageMemoryEstimation.test.ts +++ b/packages/suite-base/src/players/messageMemoryEstimation.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/messageMemoryEstimation.ts b/packages/suite-base/src/players/messageMemoryEstimation.ts index d99465d1d3..66944bfc01 100644 --- a/packages/suite-base/src/players/messageMemoryEstimation.ts +++ b/packages/suite-base/src/players/messageMemoryEstimation.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; - import { MessageDefinitionMap } from "@foxglove/mcap-support/src/types"; +import Log from "@lichtblick/log"; + const log = Log.getLogger(__filename); /** * Values of the contants below are a (more or less) informed guesses and not guaranteed to be accurate. diff --git a/packages/suite-base/src/players/subscribePayloadFromMessagePath.test.ts b/packages/suite-base/src/players/subscribePayloadFromMessagePath.test.ts index c43e404984..fdc40e0807 100644 --- a/packages/suite-base/src/players/subscribePayloadFromMessagePath.test.ts +++ b/packages/suite-base/src/players/subscribePayloadFromMessagePath.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/subscribePayloadFromMessagePath.ts b/packages/suite-base/src/players/subscribePayloadFromMessagePath.ts index c42e60739d..e5f65eea62 100644 --- a/packages/suite-base/src/players/subscribePayloadFromMessagePath.ts +++ b/packages/suite-base/src/players/subscribePayloadFromMessagePath.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/players/types.ts b/packages/suite-base/src/players/types.ts index c470f0a371..0531641416 100644 --- a/packages/suite-base/src/players/types.ts +++ b/packages/suite-base/src/players/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,9 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { MessageDefinition } from "@foxglove/message-definition"; +import { Time } from "@foxglove/rostime"; + import type { MessageEvent, Metadata, ParameterValue } from "@lichtblick/suite"; import { Immutable } from "@lichtblick/suite"; import { Asset } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; @@ -19,9 +25,6 @@ import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { Range } from "@lichtblick/suite-base/util/ranges"; import { NotificationSeverity } from "@lichtblick/suite-base/util/sendNotification"; -import { MessageDefinition } from "@foxglove/message-definition"; -import { Time } from "@foxglove/rostime"; - // re-exported until other import sites are updated from players/types to @lichtblick/suite export type { MessageEvent }; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.stories.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.stories.tsx index 87dcecf08b..5a002fa806 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.stories.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.tsx index 05e20f6feb..72290936c9 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/IncompatibleLayoutVersionAlert.tsx @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; import { Button, Dialog, @@ -14,6 +16,8 @@ import { } from "@mui/material"; import { useTranslation } from "react-i18next"; +import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; + type Props = { isDesktop?: boolean; onClose: () => void; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/MockCurrentLayoutProvider.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/MockCurrentLayoutProvider.tsx index 5a37676cb4..15163fa670 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/MockCurrentLayoutProvider.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/MockCurrentLayoutProvider.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback, useMemo, useRef, useState } from "react"; + import { useShallowMemo } from "@lichtblick/hooks"; import CurrentLayoutContext, { ICurrentLayout, @@ -14,7 +19,6 @@ import { PanelsActions, } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { defaultPlaybackConfig } from "@lichtblick/suite-base/providers/CurrentLayoutProvider/reducers"; -import { useCallback, useMemo, useRef, useState } from "react"; import panelsReducer from "./reducers"; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/defaultLayout.ts b/packages/suite-base/src/providers/CurrentLayoutProvider/defaultLayout.ts index ddb4e5a9ae..afeba3abb7 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/defaultLayout.ts +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/defaultLayout.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/index.test.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/index.test.tsx index 070b05f141..2aeb471a89 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/index.test.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/index.test.tsx @@ -1,8 +1,15 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { act, renderHook } from "@testing-library/react"; +import { SnackbarProvider } from "notistack"; +import { useEffect } from "react"; + import { Condvar } from "@lichtblick/den/async"; import { CurrentLayoutSyncAdapter } from "@lichtblick/suite-base/components/CurrentLayoutSyncAdapter"; import { @@ -21,9 +28,6 @@ import CurrentLayoutProvider, { MAX_SUPPORTED_LAYOUT_VERSION, } from "@lichtblick/suite-base/providers/CurrentLayoutProvider"; import { ILayoutManager } from "@lichtblick/suite-base/services/ILayoutManager"; -import { act, renderHook } from "@testing-library/react"; -import { SnackbarProvider } from "notistack"; -import { useEffect } from "react"; const TEST_LAYOUT: LayoutData = { layout: "ExamplePanel!1", diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/index.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/index.tsx index 16968bc967..3356612b5f 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/index.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/index.tsx @@ -1,7 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { useSnackbar } from "notistack"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { getNodeAtPath } from "react-mosaic-component"; +import { useAsync, useAsyncFn, useMountedState } from "react-use"; +import shallowequal from "shallowequal"; +import { v4 as uuidv4 } from "uuid"; + import { useShallowMemo } from "@lichtblick/hooks"; import Logger from "@lichtblick/log"; import { VariableValue } from "@lichtblick/suite"; @@ -34,13 +45,6 @@ import { LayoutManagerEventTypes } from "@lichtblick/suite-base/services/ILayout import { PanelConfig, PlaybackConfig, UserScripts } from "@lichtblick/suite-base/types/panels"; import { windowAppURLState } from "@lichtblick/suite-base/util/appURLState"; import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import * as _ from "lodash-es"; -import { useSnackbar } from "notistack"; -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; -import { getNodeAtPath } from "react-mosaic-component"; -import { useAsync, useAsyncFn, useMountedState } from "react-use"; -import shallowequal from "shallowequal"; -import { v4 as uuidv4 } from "uuid"; import { IncompatibleLayoutVersionAlert } from "./IncompatibleLayoutVersionAlert"; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.test.tsx b/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.test.tsx index be74c17d82..baa0f131ca 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.test.tsx +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.test.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { getLeaves, MosaicNode, MosaicParent } from "react-mosaic-component"; + import { CreateTabPanelPayload, LayoutData, @@ -19,7 +24,6 @@ import { TabPanelConfig } from "@lichtblick/suite-base/types/layouts"; import { MosaicDropTargetPosition } from "@lichtblick/suite-base/types/panels"; import { TAB_PANEL_TYPE } from "@lichtblick/suite-base/util/globalConstants"; import { getPanelTypeFromId } from "@lichtblick/suite-base/util/layout"; -import { getLeaves, MosaicNode, MosaicParent } from "react-mosaic-component"; import panelsReducer, { defaultPlaybackConfig } from "./reducers"; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.ts b/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.ts index ed0c0edcc0..c4f13206a1 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.ts +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/reducers.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,19 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; +import { + MosaicNode, + MosaicPath, + createDragToUpdates, + createHideUpdate, + createRemoveUpdate, + getLeaves, + getNodeAtPath, + updateTree, +} from "react-mosaic-component"; +import { MarkOptional } from "ts-essentials"; + import { filterMap } from "@lichtblick/den/collection"; import { AddPanelPayload, @@ -50,18 +66,6 @@ import { replaceAndRemovePanels, updateTabPanelLayout, } from "@lichtblick/suite-base/util/layout"; -import * as _ from "lodash-es"; -import { - MosaicNode, - MosaicPath, - createDragToUpdates, - createHideUpdate, - createRemoveUpdate, - getLeaves, - getNodeAtPath, - updateTree, -} from "react-mosaic-component"; -import { MarkOptional } from "ts-essentials"; import { isTabPanelConfig } from "../../util/layout"; diff --git a/packages/suite-base/src/providers/CurrentLayoutProvider/toggleSelectedPanel.ts b/packages/suite-base/src/providers/CurrentLayoutProvider/toggleSelectedPanel.ts index 17c30285eb..267d80a391 100644 --- a/packages/suite-base/src/providers/CurrentLayoutProvider/toggleSelectedPanel.ts +++ b/packages/suite-base/src/providers/CurrentLayoutProvider/toggleSelectedPanel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,8 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; + import { TabPanelConfig } from "@lichtblick/suite-base/types/layouts"; import { SavedProps } from "@lichtblick/suite-base/types/panels"; import { @@ -18,7 +23,6 @@ import { getParentTabPanelByPanelId, isTabPanel, } from "@lichtblick/suite-base/util/layout"; -import * as _ from "lodash-es"; export default function toggleSelectedPanel( panelId: string, diff --git a/packages/suite-base/src/providers/EventsProvider.tsx b/packages/suite-base/src/providers/EventsProvider.tsx index 07ea38b21f..ecf5fa2324 100644 --- a/packages/suite-base/src/providers/EventsProvider.tsx +++ b/packages/suite-base/src/providers/EventsProvider.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ReactNode, useState } from "react"; +import { AsyncState } from "react-use/lib/useAsyncFn"; +import { createStore } from "zustand"; + import { EventsContext, EventsStore, TimelinePositionedEvent, } from "@lichtblick/suite-base/context/EventsContext"; -import { ReactNode, useState } from "react"; -import { AsyncState } from "react-use/lib/useAsyncFn"; -import { createStore } from "zustand"; const NO_EVENTS: TimelinePositionedEvent[] = []; @@ -34,7 +38,7 @@ function createEventsStore() { setFilter: (filter: string) => { set({ filter }); }, - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters setEventsSupported: (eventsSupported: boolean) => { set({ eventsSupported }); }, diff --git a/packages/suite-base/src/providers/ExtensionCatalogProvider.test.tsx b/packages/suite-base/src/providers/ExtensionCatalogProvider.test.tsx index e69a3a5733..dbd838497f 100644 --- a/packages/suite-base/src/providers/ExtensionCatalogProvider.test.tsx +++ b/packages/suite-base/src/providers/ExtensionCatalogProvider.test.tsx @@ -1,12 +1,16 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { renderHook, waitFor } from "@testing-library/react"; + import { useExtensionCatalog } from "@lichtblick/suite-base/context/ExtensionCatalogContext"; import { ExtensionLoader } from "@lichtblick/suite-base/services/ExtensionLoader"; import { ExtensionInfo } from "@lichtblick/suite-base/types/Extensions"; -import { renderHook, waitFor } from "@testing-library/react"; import ExtensionCatalogProvider from "./ExtensionCatalogProvider"; diff --git a/packages/suite-base/src/providers/ExtensionCatalogProvider.tsx b/packages/suite-base/src/providers/ExtensionCatalogProvider.tsx index 93fbc0bc17..4f4b545db7 100644 --- a/packages/suite-base/src/providers/ExtensionCatalogProvider.tsx +++ b/packages/suite-base/src/providers/ExtensionCatalogProvider.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import React, { PropsWithChildren, useEffect, useState } from "react"; +import ReactDOM from "react-dom"; +import { StoreApi, createStore } from "zustand"; + import Logger from "@lichtblick/log"; import { ExtensionContext, @@ -17,9 +24,6 @@ import { import { TopicAliasFunctions } from "@lichtblick/suite-base/players/TopicAliasingPlayer/aliasing"; import { ExtensionLoader } from "@lichtblick/suite-base/services/ExtensionLoader"; import { ExtensionInfo, ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; -import React, { PropsWithChildren, useEffect, useState } from "react"; -import ReactDOM from "react-dom"; -import { StoreApi, createStore } from "zustand"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/providers/ExtensionMarketplaceProvider.tsx b/packages/suite-base/src/providers/ExtensionMarketplaceProvider.tsx index 3861b11042..107e013d1f 100644 --- a/packages/suite-base/src/providers/ExtensionMarketplaceProvider.tsx +++ b/packages/suite-base/src/providers/ExtensionMarketplaceProvider.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback } from "react"; + import { useShallowMemo } from "@lichtblick/hooks"; import ExtensionMarketplaceContext, { ExtensionMarketplaceDetail, } from "@lichtblick/suite-base/context/ExtensionMarketplaceContext"; -import { useCallback } from "react"; const MARKETPLACE_URL = "https://raw.githubusercontent.com/foxglove/studio-extension-marketplace/main/extensions.json"; diff --git a/packages/suite-base/src/providers/LayoutManagerProvider.test.tsx b/packages/suite-base/src/providers/LayoutManagerProvider.test.tsx index 8e0c591952..258713eba9 100644 --- a/packages/suite-base/src/providers/LayoutManagerProvider.test.tsx +++ b/packages/suite-base/src/providers/LayoutManagerProvider.test.tsx @@ -1,8 +1,14 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { render, waitFor } from "@testing-library/react"; +import { useNetworkState } from "react-use"; + import { useVisibilityState } from "@lichtblick/hooks"; import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { useLayoutStorage } from "@lichtblick/suite-base/context/LayoutStorageContext"; @@ -10,8 +16,6 @@ import { useRemoteLayoutStorage } from "@lichtblick/suite-base/context/RemoteLay import LayoutManagerProvider from "@lichtblick/suite-base/providers/LayoutManagerProvider"; import { LayoutLoader } from "@lichtblick/suite-base/services/ILayoutLoader"; import MockLayoutManager from "@lichtblick/suite-base/services/LayoutManager/MockLayoutManager"; -import { render, waitFor } from "@testing-library/react"; -import { useNetworkState } from "react-use"; // Mock dependencies jest.mock("react-use"); diff --git a/packages/suite-base/src/providers/LayoutManagerProvider.tsx b/packages/suite-base/src/providers/LayoutManagerProvider.tsx index 68c8b7a37a..40cab56058 100644 --- a/packages/suite-base/src/providers/LayoutManagerProvider.tsx +++ b/packages/suite-base/src/providers/LayoutManagerProvider.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useEffect, useMemo } from "react"; +import { useNetworkState } from "react-use"; + import { useVisibilityState } from "@lichtblick/hooks"; import Logger from "@lichtblick/log"; import LayoutManagerContext from "@lichtblick/suite-base/context/LayoutManagerContext"; @@ -10,8 +16,6 @@ import { useRemoteLayoutStorage } from "@lichtblick/suite-base/context/RemoteLay import { LayoutLoader } from "@lichtblick/suite-base/services/ILayoutLoader"; import LayoutManager from "@lichtblick/suite-base/services/LayoutManager/LayoutManager"; import delay from "@lichtblick/suite-base/util/delay"; -import { useEffect, useMemo } from "react"; -import { useNetworkState } from "react-use"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/providers/PanelCatalogProvider.tsx b/packages/suite-base/src/providers/PanelCatalogProvider.tsx index 7b4072727d..8ea5ae871a 100644 --- a/packages/suite-base/src/providers/PanelCatalogProvider.tsx +++ b/packages/suite-base/src/providers/PanelCatalogProvider.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { PropsWithChildren, useMemo } from "react"; +import { useTranslation } from "react-i18next"; + import Panel from "@lichtblick/suite-base/components/Panel"; import { PanelExtensionAdapter } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { useExtensionCatalog } from "@lichtblick/suite-base/context/ExtensionCatalogContext"; @@ -11,8 +17,6 @@ import PanelCatalogContext, { } from "@lichtblick/suite-base/context/PanelCatalogContext"; import * as panels from "@lichtblick/suite-base/panels"; import { SaveConfig } from "@lichtblick/suite-base/types/panels"; -import { PropsWithChildren, useMemo } from "react"; -import { useTranslation } from "react-i18next"; type PanelProps = { config: unknown; diff --git a/packages/suite-base/src/providers/PanelStateContextProvider.tsx b/packages/suite-base/src/providers/PanelStateContextProvider.tsx index 44c1498f23..6260de1e9f 100644 --- a/packages/suite-base/src/providers/PanelStateContextProvider.tsx +++ b/packages/suite-base/src/providers/PanelStateContextProvider.tsx @@ -1,7 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { PropsWithChildren, useCallback, useEffect, useState } from "react"; +import { StoreApi, createStore } from "zustand"; + import { usePanelContext } from "@lichtblick/suite-base/components/PanelContext"; import { ImmutableSettingsTree, @@ -9,8 +15,6 @@ import { PanelStateStore, usePanelStateStore, } from "@lichtblick/suite-base/context/PanelStateContext"; -import { PropsWithChildren, useCallback, useEffect, useState } from "react"; -import { StoreApi, createStore } from "zustand"; function createPanelStateStore(initialState?: Partial): StoreApi { return createStore((set) => { diff --git a/packages/suite-base/src/providers/ProblemsContextProvider.tsx b/packages/suite-base/src/providers/ProblemsContextProvider.tsx index 7ff3b40b71..11a7698887 100644 --- a/packages/suite-base/src/providers/ProblemsContextProvider.tsx +++ b/packages/suite-base/src/providers/ProblemsContextProvider.tsx @@ -1,15 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Immutable } from "immer"; +import { ReactNode, useState } from "react"; +import { StoreApi, create } from "zustand"; + import { ProblemsContext, ProblemsContextStore, SessionProblem, } from "@lichtblick/suite-base/context/ProblemsContext"; -import { Immutable } from "immer"; -import { ReactNode, useState } from "react"; -import { StoreApi, create } from "zustand"; function createProblemsStore(): StoreApi { return create((set, get) => { diff --git a/packages/suite-base/src/providers/StudioLogsSettingsProvider/StudioLogsSettingsProvider.tsx b/packages/suite-base/src/providers/StudioLogsSettingsProvider/StudioLogsSettingsProvider.tsx index e4d8af1ea1..f6fecea91e 100644 --- a/packages/suite-base/src/providers/StudioLogsSettingsProvider/StudioLogsSettingsProvider.tsx +++ b/packages/suite-base/src/providers/StudioLogsSettingsProvider/StudioLogsSettingsProvider.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Log from "@lichtblick/log"; -import { StudioLogsSettingsContext } from "@lichtblick/suite-base/context/StudioLogsSettingsContext"; import { PropsWithChildren, useEffect, useRef, useState } from "react"; import { useLocalStorage } from "react-use"; +import Log from "@lichtblick/log"; +import { StudioLogsSettingsContext } from "@lichtblick/suite-base/context/StudioLogsSettingsContext"; + import { createStudioLogsSettingsStore } from "./store"; import { LocalStorageSaveState } from "./types"; diff --git a/packages/suite-base/src/providers/StudioLogsSettingsProvider/index.ts b/packages/suite-base/src/providers/StudioLogsSettingsProvider/index.ts index 4279bfd3df..e7e8fef0b8 100644 --- a/packages/suite-base/src/providers/StudioLogsSettingsProvider/index.ts +++ b/packages/suite-base/src/providers/StudioLogsSettingsProvider/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/providers/StudioLogsSettingsProvider/store.ts b/packages/suite-base/src/providers/StudioLogsSettingsProvider/store.ts index 849e9d1343..55e7361d48 100644 --- a/packages/suite-base/src/providers/StudioLogsSettingsProvider/store.ts +++ b/packages/suite-base/src/providers/StudioLogsSettingsProvider/store.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createStore, StoreApi } from "zustand"; + import Log, { Logger, LogLevel, toLogLevel } from "@lichtblick/log"; import { IStudioLogsSettings, StudioLogConfigChannel, } from "@lichtblick/suite-base/context/StudioLogsSettingsContext"; -import { createStore, StoreApi } from "zustand"; import { LocalStorageSaveState } from "./types"; diff --git a/packages/suite-base/src/providers/StudioLogsSettingsProvider/types.ts b/packages/suite-base/src/providers/StudioLogsSettingsProvider/types.ts index cc6629c1c1..b65ebe17fa 100644 --- a/packages/suite-base/src/providers/StudioLogsSettingsProvider/types.ts +++ b/packages/suite-base/src/providers/StudioLogsSettingsProvider/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/providers/TimelineInteractionStateProvider.tsx b/packages/suite-base/src/providers/TimelineInteractionStateProvider.tsx index 4a4b9aea5f..da2bbe792a 100644 --- a/packages/suite-base/src/providers/TimelineInteractionStateProvider.tsx +++ b/packages/suite-base/src/providers/TimelineInteractionStateProvider.tsx @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { ReactNode, useState } from "react"; +import { createStore, StoreApi } from "zustand"; + import { TimelinePositionedEvent } from "@lichtblick/suite-base/context/EventsContext"; import { TimelineInteractionStateContext, @@ -9,9 +16,6 @@ import { SyncBounds, } from "@lichtblick/suite-base/context/TimelineInteractionStateContext"; import { HoverValue } from "@lichtblick/suite-base/types/hoverValue"; -import * as _ from "lodash-es"; -import { ReactNode, useState } from "react"; -import { createStore, StoreApi } from "zustand"; function createTimelineInteractionStateStore(): StoreApi { return createStore((set) => { diff --git a/packages/suite-base/src/providers/UserProfileLocalStorageProvider.tsx b/packages/suite-base/src/providers/UserProfileLocalStorageProvider.tsx index b92749bd6e..2ae3ecb936 100644 --- a/packages/suite-base/src/providers/UserProfileLocalStorageProvider.tsx +++ b/packages/suite-base/src/providers/UserProfileLocalStorageProvider.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { useCallback, useEffect } from "react"; + import { useShallowMemo } from "@lichtblick/hooks"; import { UserProfile, UserProfileStorageContext, } from "@lichtblick/suite-base/context/UserProfileStorageContext"; -import * as _ from "lodash-es"; -import { useCallback, useEffect } from "react"; const DEFAULT_PROFILE: UserProfile = {}; const LOCAL_STORAGE_KEY = "studio.profile-data"; diff --git a/packages/suite-base/src/providers/WorkspaceContextProvider.tsx b/packages/suite-base/src/providers/WorkspaceContextProvider.tsx index 49a647096c..3cfd0c9be7 100644 --- a/packages/suite-base/src/providers/WorkspaceContextProvider.tsx +++ b/packages/suite-base/src/providers/WorkspaceContextProvider.tsx @@ -1,16 +1,20 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; +import { ReactNode, useState } from "react"; +import { StoreApi, createStore } from "zustand"; +import { persist } from "zustand/middleware"; + import { WorkspaceContext, WorkspaceContextStore, } from "@lichtblick/suite-base/context/Workspace/WorkspaceContext"; import { migrateV0WorkspaceState } from "@lichtblick/suite-base/context/Workspace/migrations"; -import * as _ from "lodash-es"; -import { ReactNode, useState } from "react"; -import { StoreApi, createStore } from "zustand"; -import { persist } from "zustand/middleware"; /** * Creates the default initial state for the workspace store. diff --git a/packages/suite-base/src/reportError.ts b/packages/suite-base/src/reportError.ts index 26afbe18c9..46ea8bff9f 100644 --- a/packages/suite-base/src/reportError.ts +++ b/packages/suite-base/src/reportError.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/screens/LaunchPreference.tsx b/packages/suite-base/src/screens/LaunchPreference.tsx index 0cd07246e3..92c239a6d7 100644 --- a/packages/suite-base/src/screens/LaunchPreference.tsx +++ b/packages/suite-base/src/screens/LaunchPreference.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { PropsWithChildren } from "react"; + import { useSessionStorageValue } from "@lichtblick/hooks"; import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; -import { PropsWithChildren } from "react"; import { LaunchPreferenceScreen } from "./LaunchPreferenceScreen"; import { LaunchingInDesktopScreen } from "./LaunchingInDesktopScreen"; diff --git a/packages/suite-base/src/screens/LaunchPreferenceScreen.stories.tsx b/packages/suite-base/src/screens/LaunchPreferenceScreen.stories.tsx index b9a2ef9d72..af54c9ee00 100644 --- a/packages/suite-base/src/screens/LaunchPreferenceScreen.stories.tsx +++ b/packages/suite-base/src/screens/LaunchPreferenceScreen.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LaunchPreferenceScreen } from "@lichtblick/suite-base/screens/LaunchPreferenceScreen"; import { StoryObj } from "@storybook/react"; import { ReactElement } from "react"; +import { LaunchPreferenceScreen } from "@lichtblick/suite-base/screens/LaunchPreferenceScreen"; + export default { title: "LaunchPreferenceScreen", component: LaunchPreferenceScreen, diff --git a/packages/suite-base/src/screens/LaunchPreferenceScreen.tsx b/packages/suite-base/src/screens/LaunchPreferenceScreen.tsx index a999cc44bd..0c2ef6631d 100644 --- a/packages/suite-base/src/screens/LaunchPreferenceScreen.tsx +++ b/packages/suite-base/src/screens/LaunchPreferenceScreen.tsx @@ -1,12 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { useSessionStorageValue } from "@lichtblick/hooks"; -import { AppSetting } from "@lichtblick/suite-base/AppSetting"; -import Stack from "@lichtblick/suite-base/components/Stack"; -import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; -import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; import { Button, Checkbox, @@ -20,6 +18,12 @@ import { import { ReactElement, useState } from "react"; import { makeStyles } from "tss-react/mui"; +import { useSessionStorageValue } from "@lichtblick/hooks"; +import { AppSetting } from "@lichtblick/suite-base/AppSetting"; +import Stack from "@lichtblick/suite-base/components/Stack"; +import { useAppConfigurationValue } from "@lichtblick/suite-base/hooks"; +import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; + const useStyles = makeStyles()((theme) => ({ button: { textAlign: "left", diff --git a/packages/suite-base/src/screens/LaunchingInDesktopScreen.stories.tsx b/packages/suite-base/src/screens/LaunchingInDesktopScreen.stories.tsx index bbb4f35687..2e62f76b1d 100644 --- a/packages/suite-base/src/screens/LaunchingInDesktopScreen.stories.tsx +++ b/packages/suite-base/src/screens/LaunchingInDesktopScreen.stories.tsx @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LaunchingInDesktopScreen } from "@lichtblick/suite-base/screens/LaunchingInDesktopScreen"; import { StoryObj } from "@storybook/react"; import { ReactElement } from "react"; +import { LaunchingInDesktopScreen } from "@lichtblick/suite-base/screens/LaunchingInDesktopScreen"; + export default { title: "LaunchingInDesktopScreen", component: LaunchingInDesktopScreen, diff --git a/packages/suite-base/src/screens/LaunchingInDesktopScreen.tsx b/packages/suite-base/src/screens/LaunchingInDesktopScreen.tsx index 13eaafaad5..6de4dd4ad5 100644 --- a/packages/suite-base/src/screens/LaunchingInDesktopScreen.tsx +++ b/packages/suite-base/src/screens/LaunchingInDesktopScreen.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Link, Typography } from "@mui/material"; +import { ReactElement, useEffect } from "react"; + import { useSessionStorageValue } from "@lichtblick/hooks"; import { AppSetting } from "@lichtblick/suite-base/AppSetting"; import Stack from "@lichtblick/suite-base/components/Stack"; import { LaunchPreferenceValue } from "@lichtblick/suite-base/types/LaunchPreferenceValue"; -import { Link, Typography } from "@mui/material"; -import { ReactElement, useEffect } from "react"; export function LaunchingInDesktopScreen(): ReactElement { const [, setLaunchPreference] = useSessionStorageValue(AppSetting.LAUNCH_PREFERENCE); diff --git a/packages/suite-base/src/services/ExtensionLoader.ts b/packages/suite-base/src/services/ExtensionLoader.ts index 5122992a5e..baaf4f17c5 100644 --- a/packages/suite-base/src/services/ExtensionLoader.ts +++ b/packages/suite-base/src/services/ExtensionLoader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/IAnalytics.ts b/packages/suite-base/src/services/IAnalytics.ts index 9238db0503..d8f89ff36a 100644 --- a/packages/suite-base/src/services/IAnalytics.ts +++ b/packages/suite-base/src/services/IAnalytics.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/IExtensionStorage.ts b/packages/suite-base/src/services/IExtensionStorage.ts index 8762b2a4eb..441d9cb982 100644 --- a/packages/suite-base/src/services/IExtensionStorage.ts +++ b/packages/suite-base/src/services/IExtensionStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/ILayoutLoader.ts b/packages/suite-base/src/services/ILayoutLoader.ts index 82ea63ecf1..98c88ca3d9 100644 --- a/packages/suite-base/src/services/ILayoutLoader.ts +++ b/packages/suite-base/src/services/ILayoutLoader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/ILayoutManager.ts b/packages/suite-base/src/services/ILayoutManager.ts index 0f7e6f18aa..faecf5867d 100644 --- a/packages/suite-base/src/services/ILayoutManager.ts +++ b/packages/suite-base/src/services/ILayoutManager.ts @@ -1,11 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import EventEmitter from "eventemitter3"; + import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { Layout, LayoutPermission } from "@lichtblick/suite-base/services/ILayoutStorage"; -import EventEmitter from "eventemitter3"; export type LayoutManagerChangeEvent = | { type: "delete"; updatedLayout?: undefined; layoutId: LayoutID } diff --git a/packages/suite-base/src/services/ILayoutStorage.ts b/packages/suite-base/src/services/ILayoutStorage.ts index 3709abfa58..fc96bfe4ff 100644 --- a/packages/suite-base/src/services/ILayoutStorage.ts +++ b/packages/suite-base/src/services/ILayoutStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/IRemoteLayoutStorage.ts b/packages/suite-base/src/services/IRemoteLayoutStorage.ts index c14a336774..fbace89136 100644 --- a/packages/suite-base/src/services/IRemoteLayoutStorage.ts +++ b/packages/suite-base/src/services/IRemoteLayoutStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/IdbExtensionLoader.test.ts b/packages/suite-base/src/services/IdbExtensionLoader.test.ts index 0e0a8da4da..e1242c7088 100644 --- a/packages/suite-base/src/services/IdbExtensionLoader.test.ts +++ b/packages/suite-base/src/services/IdbExtensionLoader.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/IdbExtensionLoader.ts b/packages/suite-base/src/services/IdbExtensionLoader.ts index bf5efde0fd..9ff316a805 100644 --- a/packages/suite-base/src/services/IdbExtensionLoader.ts +++ b/packages/suite-base/src/services/IdbExtensionLoader.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import JSZip from "jszip"; + import Log from "@lichtblick/log"; import { ExtensionLoader } from "@lichtblick/suite-base/services/ExtensionLoader"; import { IExtensionStorage } from "@lichtblick/suite-base/services/IExtensionStorage"; import { ExtensionInfo, ExtensionNamespace } from "@lichtblick/suite-base/types/Extensions"; -import JSZip from "jszip"; import { IdbExtensionStorage } from "./IdbExtensionStorage"; diff --git a/packages/suite-base/src/services/IdbExtensionStorage.ts b/packages/suite-base/src/services/IdbExtensionStorage.ts index 9a2edb4eea..b56a7cc6c5 100644 --- a/packages/suite-base/src/services/IdbExtensionStorage.ts +++ b/packages/suite-base/src/services/IdbExtensionStorage.ts @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as IDB from "idb/with-async-ittr"; + import Log from "@lichtblick/log"; import { IExtensionStorage, StoredExtension, } from "@lichtblick/suite-base/services/IExtensionStorage"; import { ExtensionInfo } from "@lichtblick/suite-base/types/Extensions"; -import * as IDB from "idb/with-async-ittr"; const log = Log.getLogger(__filename); diff --git a/packages/suite-base/src/services/LayoutManager/LayoutManager.ts b/packages/suite-base/src/services/LayoutManager/LayoutManager.ts index 7a3dc40e83..08175a0a0a 100644 --- a/packages/suite-base/src/services/LayoutManager/LayoutManager.ts +++ b/packages/suite-base/src/services/LayoutManager/LayoutManager.ts @@ -1,7 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import EventEmitter from "eventemitter3"; +import * as _ from "lodash-es"; +import { v4 as uuidv4 } from "uuid"; + import { MutexLocked } from "@lichtblick/den/async"; import Logger from "@lichtblick/log"; import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; @@ -24,9 +31,6 @@ import { IRemoteLayoutStorage, RemoteLayout, } from "@lichtblick/suite-base/services/IRemoteLayoutStorage"; -import EventEmitter from "eventemitter3"; -import * as _ from "lodash-es"; -import { v4 as uuidv4 } from "uuid"; import { NamespacedLayoutStorage } from "./NamespacedLayoutStorage"; import WriteThroughLayoutCache from "./WriteThroughLayoutCache"; @@ -108,7 +112,7 @@ export default class LayoutManager implements ILayoutManager { public error: undefined | Error = undefined; - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters public setOnline(online: boolean): void { this.isOnline = online; this.#emitter.emit("onlinechange"); diff --git a/packages/suite-base/src/services/LayoutManager/MockLayoutManager.ts b/packages/suite-base/src/services/LayoutManager/MockLayoutManager.ts index 3b2c8d2f9f..a5a20209d2 100644 --- a/packages/suite-base/src/services/LayoutManager/MockLayoutManager.ts +++ b/packages/suite-base/src/services/LayoutManager/MockLayoutManager.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/LayoutManager/NamespacedLayoutStorage.ts b/packages/suite-base/src/services/LayoutManager/NamespacedLayoutStorage.ts index 567de75ba7..f331fe0300 100644 --- a/packages/suite-base/src/services/LayoutManager/NamespacedLayoutStorage.ts +++ b/packages/suite-base/src/services/LayoutManager/NamespacedLayoutStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/LayoutManager/WriteThroughLayoutCache.ts b/packages/suite-base/src/services/LayoutManager/WriteThroughLayoutCache.ts index 6bc26c2c12..8c0c2240c1 100644 --- a/packages/suite-base/src/services/LayoutManager/WriteThroughLayoutCache.ts +++ b/packages/suite-base/src/services/LayoutManager/WriteThroughLayoutCache.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/LayoutManager/compareLayouts.test.ts b/packages/suite-base/src/services/LayoutManager/compareLayouts.test.ts index 28f48db2c4..31274e0903 100644 --- a/packages/suite-base/src/services/LayoutManager/compareLayouts.test.ts +++ b/packages/suite-base/src/services/LayoutManager/compareLayouts.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/LayoutManager/compareLayouts.ts b/packages/suite-base/src/services/LayoutManager/compareLayouts.ts index 28cfe77878..ac3220ce29 100644 --- a/packages/suite-base/src/services/LayoutManager/compareLayouts.ts +++ b/packages/suite-base/src/services/LayoutManager/compareLayouts.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { diff } from "just-diff"; +import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; + /** * isLayoutEqual compares two LayoutData instances for "equality". If the two instances are * considered "equal" then the function returns true. If the two instances are not equal it returns diff --git a/packages/suite-base/src/services/LayoutManager/computeLayoutSyncOperations.ts b/packages/suite-base/src/services/LayoutManager/computeLayoutSyncOperations.ts index 2c7a756ced..d10e066889 100644 --- a/packages/suite-base/src/services/LayoutManager/computeLayoutSyncOperations.ts +++ b/packages/suite-base/src/services/LayoutManager/computeLayoutSyncOperations.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/MockLayoutStorage.ts b/packages/suite-base/src/services/MockLayoutStorage.ts index 36d65bf85b..2e5b9df3e2 100644 --- a/packages/suite-base/src/services/MockLayoutStorage.ts +++ b/packages/suite-base/src/services/MockLayoutStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/NullAnalytics.ts b/packages/suite-base/src/services/NullAnalytics.ts index 2fe5a4e0c1..3989d73935 100644 --- a/packages/suite-base/src/services/NullAnalytics.ts +++ b/packages/suite-base/src/services/NullAnalytics.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/messagePathDragging/MessagePathSelectionProvider.tsx b/packages/suite-base/src/services/messagePathDragging/MessagePathSelectionProvider.tsx index 01645f9dc7..e32e2e2b2d 100644 --- a/packages/suite-base/src/services/messagePathDragging/MessagePathSelectionProvider.tsx +++ b/packages/suite-base/src/services/messagePathDragging/MessagePathSelectionProvider.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; import { createContext, useMemo } from "react"; +import { DraggedMessagePath } from "@lichtblick/suite-base/components/PanelExtensionAdapter"; + type MessagePathSelectionContext = { getSelectedItems: () => DraggedMessagePath[]; }; diff --git a/packages/suite-base/src/services/messagePathDragging/index.ts b/packages/suite-base/src/services/messagePathDragging/index.ts index 42f510f162..287be11c6a 100644 --- a/packages/suite-base/src/services/messagePathDragging/index.ts +++ b/packages/suite-base/src/services/messagePathDragging/index.ts @@ -1,14 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { - DraggedMessagePath, - MessagePathDropConfig, - MessagePathDropStatus, -} from "@lichtblick/suite-base/components/PanelExtensionAdapter"; -import { MessagePathSelectionContextInternal } from "@lichtblick/suite-base/services/messagePathDragging/MessagePathSelectionProvider"; import { CSSProperties, useCallback, useContext, useLayoutEffect, useRef, useState } from "react"; import { ConnectDragPreview, @@ -19,6 +15,14 @@ import { useDrop, } from "react-dnd"; +import Logger from "@lichtblick/log"; +import { + DraggedMessagePath, + MessagePathDropConfig, + MessagePathDropStatus, +} from "@lichtblick/suite-base/components/PanelExtensionAdapter"; +import { MessagePathSelectionContextInternal } from "@lichtblick/suite-base/services/messagePathDragging/MessagePathSelectionProvider"; + import { MessagePathDragParams } from "./types"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/services/messagePathDragging/types.ts b/packages/suite-base/src/services/messagePathDragging/types.ts index a12e95c89e..4f4428417b 100644 --- a/packages/suite-base/src/services/messagePathDragging/types.ts +++ b/packages/suite-base/src/services/messagePathDragging/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/migrateLayout.ts b/packages/suite-base/src/services/migrateLayout.ts index edba1866d7..ee4edf5ac9 100644 --- a/packages/suite-base/src/services/migrateLayout.ts +++ b/packages/suite-base/src/services/migrateLayout.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MarkOptional } from "ts-essentials"; + import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { ISO8601Timestamp, Layout } from "@lichtblick/suite-base/services/ILayoutStorage"; -import { MarkOptional } from "ts-essentials"; import { migrateLegacyToNew3DPanels } from "./migrateLayout/migrateLegacyToNew3DPanels"; diff --git a/packages/suite-base/src/services/migrateLayout/index.ts b/packages/suite-base/src/services/migrateLayout/index.ts index c1966fe9d2..c6b8d1177f 100644 --- a/packages/suite-base/src/services/migrateLayout/index.ts +++ b/packages/suite-base/src/services/migrateLayout/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.test.ts b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.test.ts index 42c08c808f..1053ac04a0 100644 --- a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.test.ts +++ b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts index 238d80a39e..35c203c94a 100644 --- a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts +++ b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import * as _ from "lodash-es"; + import { filterMap } from "@lichtblick/den/collection"; import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import type { RendererConfig } from "@lichtblick/suite-base/panels/ThreeDeeRender/IRenderer"; @@ -11,7 +16,6 @@ import { getPanelIdForType, getPanelTypeFromId, } from "@lichtblick/suite-base/util/layout"; -import * as _ from "lodash-es"; import { replacePanel } from "./replacePanel"; diff --git a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.test.ts b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.test.ts index 3613fd32fc..fb16625aca 100644 --- a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.test.ts +++ b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.ts b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.ts index 9b159007f5..18e90c9904 100644 --- a/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.ts +++ b/packages/suite-base/src/services/migrateLayout/migrateLegacyToNewImagePanels.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/services/migrateLayout/migratePanelsState.ts b/packages/suite-base/src/services/migrateLayout/migratePanelsState.ts index 0dd7782529..31b0a83bd2 100644 --- a/packages/suite-base/src/services/migrateLayout/migratePanelsState.ts +++ b/packages/suite-base/src/services/migrateLayout/migratePanelsState.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { MarkOptional } from "ts-essentials"; +import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; + import { migrateLegacyToNew3DPanels } from "./migrateLegacyToNew3DPanels"; import { migrateLegacyToNewImagePanels } from "./migrateLegacyToNewImagePanels"; diff --git a/packages/suite-base/src/services/migrateLayout/replacePanel.ts b/packages/suite-base/src/services/migrateLayout/replacePanel.ts index 485f4d12b0..9ca704768c 100644 --- a/packages/suite-base/src/services/migrateLayout/replacePanel.ts +++ b/packages/suite-base/src/services/migrateLayout/replacePanel.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { MosaicNode } from "react-mosaic-component"; + import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext/actions"; import { isTabPanel, isTabPanelConfig } from "@lichtblick/suite-base/util/layout"; -import { MosaicNode } from "react-mosaic-component"; function replacePanelInLayout( layout: MosaicNode, diff --git a/packages/suite-base/src/stories/PanelSetup.tsx b/packages/suite-base/src/stories/PanelSetup.tsx index e9bb2c415a..ae8ee38504 100644 --- a/packages/suite-base/src/stories/PanelSetup.tsx +++ b/packages/suite-base/src/stories/PanelSetup.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,6 +14,15 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import { useTheme } from "@mui/material"; +import { TFunction } from "i18next"; +import * as _ from "lodash-es"; +import { ComponentProps, ReactNode, useLayoutEffect, useMemo, useState } from "react"; +import { DndProvider } from "react-dnd"; +import { HTML5Backend } from "react-dnd-html5-backend"; +import { useTranslation } from "react-i18next"; +import { Mosaic, MosaicNode, MosaicWindow } from "react-mosaic-component"; + import { useShallowMemo } from "@lichtblick/hooks"; import { MessageEvent, @@ -53,14 +65,6 @@ import WorkspaceContextProvider from "@lichtblick/suite-base/providers/Workspace import ThemeProvider from "@lichtblick/suite-base/theme/ThemeProvider"; import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import { SavedProps, UserScripts } from "@lichtblick/suite-base/types/panels"; -import { useTheme } from "@mui/material"; -import { TFunction } from "i18next"; -import * as _ from "lodash-es"; -import { ComponentProps, ReactNode, useLayoutEffect, useMemo, useState } from "react"; -import { DndProvider } from "react-dnd"; -import { HTML5Backend } from "react-dnd-html5-backend"; -import { useTranslation } from "react-i18next"; -import { Mosaic, MosaicNode, MosaicWindow } from "react-mosaic-component"; import "react-mosaic-component/react-mosaic-component.css"; diff --git a/packages/suite-base/src/stories/ReadySignalContext.ts b/packages/suite-base/src/stories/ReadySignalContext.ts index 9078509480..d5d857545b 100644 --- a/packages/suite-base/src/stories/ReadySignalContext.ts +++ b/packages/suite-base/src/stories/ReadySignalContext.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/stories/inScreenshotTests.stories.tsx b/packages/suite-base/src/stories/inScreenshotTests.stories.tsx index a2036e4b34..905b7074a4 100644 --- a/packages/suite-base/src/stories/inScreenshotTests.stories.tsx +++ b/packages/suite-base/src/stories/inScreenshotTests.stories.tsx @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import inScreenshotTests from "@lichtblick/suite-base/stories/inScreenshotTests"; import { StoryObj } from "@storybook/react"; +import inScreenshotTests from "@lichtblick/suite-base/stories/inScreenshotTests"; + export default { title: "inScreenshotTests", }; diff --git a/packages/suite-base/src/stories/inScreenshotTests.ts b/packages/suite-base/src/stories/inScreenshotTests.ts index 5d5584e8f9..861e9c9753 100644 --- a/packages/suite-base/src/stories/inScreenshotTests.ts +++ b/packages/suite-base/src/stories/inScreenshotTests.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/stories/storyHelpers.tsx b/packages/suite-base/src/stories/storyHelpers.tsx index 064f99ef1c..750b902baa 100644 --- a/packages/suite-base/src/stories/storyHelpers.tsx +++ b/packages/suite-base/src/stories/storyHelpers.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/MemoryStorage.ts b/packages/suite-base/src/test/MemoryStorage.ts index 168c1b9c09..97147fb0ae 100644 --- a/packages/suite-base/src/test/MemoryStorage.ts +++ b/packages/suite-base/src/test/MemoryStorage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/MockSendNotification.ts b/packages/suite-base/src/test/MockSendNotification.ts index e9fc0f0475..ebcd76dd71 100644 --- a/packages/suite-base/src/test/MockSendNotification.ts +++ b/packages/suite-base/src/test/MockSendNotification.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mocks/MockCss.ts b/packages/suite-base/src/test/mocks/MockCss.ts index eeea9978a3..06a8dc9219 100644 --- a/packages/suite-base/src/test/mocks/MockCss.ts +++ b/packages/suite-base/src/test/mocks/MockCss.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mocks/MockSvg.tsx b/packages/suite-base/src/test/mocks/MockSvg.tsx index 834d28833a..d6e2ef1fb2 100644 --- a/packages/suite-base/src/test/mocks/MockSvg.tsx +++ b/packages/suite-base/src/test/mocks/MockSvg.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mocks/fileMock.ts b/packages/suite-base/src/test/mocks/fileMock.ts index cb86b4c2b8..381dec5fdf 100644 --- a/packages/suite-base/src/test/mocks/fileMock.ts +++ b/packages/suite-base/src/test/mocks/fileMock.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mocks/makeMockEvents.ts b/packages/suite-base/src/test/mocks/makeMockEvents.ts index 95b5cb68e2..8a07c50c43 100644 --- a/packages/suite-base/src/test/mocks/makeMockEvents.ts +++ b/packages/suite-base/src/test/mocks/makeMockEvents.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { TimelinePositionedEvent } from "@lichtblick/suite-base/context/EventsContext"; +import { add, toNanoSec, toSec } from "@foxglove/rostime"; import * as _ from "lodash-es"; -import { add, toNanoSec, toSec } from "@foxglove/rostime"; +import { TimelinePositionedEvent } from "@lichtblick/suite-base/context/EventsContext"; export function makeMockEvents( count: number, diff --git a/packages/suite-base/src/test/mocks/mockMessage.ts b/packages/suite-base/src/test/mocks/mockMessage.ts index b311468f47..b68b2f0671 100644 --- a/packages/suite-base/src/test/mocks/mockMessage.ts +++ b/packages/suite-base/src/test/mocks/mockMessage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mocks/mockTopicSelection.ts b/packages/suite-base/src/test/mocks/mockTopicSelection.ts index abe06be49b..affd86c0f8 100644 --- a/packages/suite-base/src/test/mocks/mockTopicSelection.ts +++ b/packages/suite-base/src/test/mocks/mockTopicSelection.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/mouseEventsHelper.ts b/packages/suite-base/src/test/mouseEventsHelper.ts index a318a408ac..7aac3bbf25 100644 --- a/packages/suite-base/src/test/mouseEventsHelper.ts +++ b/packages/suite-base/src/test/mouseEventsHelper.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/permutations.test.ts b/packages/suite-base/src/test/permutations.test.ts index c32223313d..51c1ce6491 100644 --- a/packages/suite-base/src/test/permutations.test.ts +++ b/packages/suite-base/src/test/permutations.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/permutations.ts b/packages/suite-base/src/test/permutations.ts index 7bd8dde8ed..e4a56f4d58 100644 --- a/packages/suite-base/src/test/permutations.ts +++ b/packages/suite-base/src/test/permutations.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/setup.ts b/packages/suite-base/src/test/setup.ts index 014d34be3b..1076f73e88 100644 --- a/packages/suite-base/src/test/setup.ts +++ b/packages/suite-base/src/test/setup.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import setImmediate from "@lichtblick/suite-base/util/setImmediate"; import util from "util"; +import setImmediate from "@lichtblick/suite-base/util/setImmediate"; + process.env.WASM_LZ4_ENVIRONMENT = "NODE"; function noOp() { diff --git a/packages/suite-base/src/test/setupTestFramework.ts b/packages/suite-base/src/test/setupTestFramework.ts index d47541c41a..538d720ff8 100644 --- a/packages/suite-base/src/test/setupTestFramework.ts +++ b/packages/suite-base/src/test/setupTestFramework.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/stubs/MonacoEditor.tsx b/packages/suite-base/src/test/stubs/MonacoEditor.tsx index 5c1864c731..1420dc0051 100644 --- a/packages/suite-base/src/test/stubs/MonacoEditor.tsx +++ b/packages/suite-base/src/test/stubs/MonacoEditor.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/transformers/neTransformer.js b/packages/suite-base/src/test/transformers/neTransformer.js index 5620eac784..b6ad81ea78 100644 --- a/packages/suite-base/src/test/transformers/neTransformer.js +++ b/packages/suite-base/src/test/transformers/neTransformer.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/transformers/rawTransformer.js b/packages/suite-base/src/test/transformers/rawTransformer.js index 9a3afdbd08..268256174c 100644 --- a/packages/suite-base/src/test/transformers/rawTransformer.js +++ b/packages/suite-base/src/test/transformers/rawTransformer.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/test/transformers/typescriptTransformerWithRawImports.js b/packages/suite-base/src/test/transformers/typescriptTransformerWithRawImports.js index c649966fad..b94f4dfa62 100644 --- a/packages/suite-base/src/test/transformers/typescriptTransformerWithRawImports.js +++ b/packages/suite-base/src/test/transformers/typescriptTransformerWithRawImports.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/theme/ThemeProvider.tsx b/packages/suite-base/src/theme/ThemeProvider.tsx index 68119942ff..20bc42338c 100644 --- a/packages/suite-base/src/theme/ThemeProvider.tsx +++ b/packages/suite-base/src/theme/ThemeProvider.tsx @@ -1,15 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import createCache from "@emotion/cache"; import { CacheProvider } from "@emotion/react"; +import { createMuiTheme } from "@foxglove/theme"; import { ThemeProvider as MuiThemeProvider } from "@mui/material"; import * as React from "react"; import { useEffect, useLayoutEffect, useMemo } from "react"; -import { createMuiTheme } from "@foxglove/theme"; - // Make sure mui styles are loaded first so that our makeStyles customizations // take precedence. const muiCache = createCache({ key: "mui", prepend: true }); diff --git a/packages/suite-base/src/theme/icons.tsx b/packages/suite-base/src/theme/icons.tsx index 28bb1f0078..1cfc56bd30 100644 --- a/packages/suite-base/src/theme/icons.tsx +++ b/packages/suite-base/src/theme/icons.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -21,6 +24,7 @@ import { Sparkle20Regular, TextBulletListLtr20Regular, } from "@fluentui/react-icons"; + import BlockheadFilledIcon from "@lichtblick/suite-base/components/BlockheadFilledIcon"; import BlockheadIcon from "@lichtblick/suite-base/components/BlockheadIcon"; import { RegisteredIconNames } from "@lichtblick/suite-base/types/Icons"; diff --git a/packages/suite-base/src/types/Bounds.ts b/packages/suite-base/src/types/Bounds.ts index 748c6fd811..2b6af9c5d0 100644 --- a/packages/suite-base/src/types/Bounds.ts +++ b/packages/suite-base/src/types/Bounds.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/Extensions.ts b/packages/suite-base/src/types/Extensions.ts index 486e8b93c5..62d363ee61 100644 --- a/packages/suite-base/src/types/Extensions.ts +++ b/packages/suite-base/src/types/Extensions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/FoxgloveMessages.ts b/packages/suite-base/src/types/FoxgloveMessages.ts index 18ee50098b..ed39eaa4a0 100644 --- a/packages/suite-base/src/types/FoxgloveMessages.ts +++ b/packages/suite-base/src/types/FoxgloveMessages.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/Icons.ts b/packages/suite-base/src/types/Icons.ts index c782cf15b4..1b541d1e31 100644 --- a/packages/suite-base/src/types/Icons.ts +++ b/packages/suite-base/src/types/Icons.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/LaunchPreferenceValue.ts b/packages/suite-base/src/types/LaunchPreferenceValue.ts index aba9eff1da..8c23af98b8 100644 --- a/packages/suite-base/src/types/LaunchPreferenceValue.ts +++ b/packages/suite-base/src/types/LaunchPreferenceValue.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/Messages.ts b/packages/suite-base/src/types/Messages.ts index 0480287e44..16be9667fd 100644 --- a/packages/suite-base/src/types/Messages.ts +++ b/packages/suite-base/src/types/Messages.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/RosDatatypes.ts b/packages/suite-base/src/types/RosDatatypes.ts index 785881ad12..375bf3d17d 100644 --- a/packages/suite-base/src/types/RosDatatypes.ts +++ b/packages/suite-base/src/types/RosDatatypes.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/hoverValue.ts b/packages/suite-base/src/types/hoverValue.ts index 8a4a5cfadc..e64b5985d9 100644 --- a/packages/suite-base/src/types/hoverValue.ts +++ b/packages/suite-base/src/types/hoverValue.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/isTypedArray.ts b/packages/suite-base/src/types/isTypedArray.ts index 5bf55c0080..48dc8426ce 100644 --- a/packages/suite-base/src/types/isTypedArray.ts +++ b/packages/suite-base/src/types/isTypedArray.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/types/layouts.ts b/packages/suite-base/src/types/layouts.ts index d5ef554e3c..f08768825c 100644 --- a/packages/suite-base/src/types/layouts.ts +++ b/packages/suite-base/src/types/layouts.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext"; import { MosaicNode } from "react-mosaic-component"; +import { LayoutData } from "@lichtblick/suite-base/context/CurrentLayoutContext"; + export type TabConfig = { title: string; layout?: MosaicNode }; export type TabPanelConfig = { diff --git a/packages/suite-base/src/types/panels.ts b/packages/suite-base/src/types/panels.ts index 203cfe8088..3f148c24a0 100644 --- a/packages/suite-base/src/types/panels.ts +++ b/packages/suite-base/src/types/panels.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/extensions.d.ts b/packages/suite-base/src/typings/extensions.d.ts index 61e39c1ea9..bf96f25285 100644 --- a/packages/suite-base/src/typings/extensions.d.ts +++ b/packages/suite-base/src/typings/extensions.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/i18next.d.ts b/packages/suite-base/src/typings/i18next.d.ts index d0d53e191c..161fc02c25 100644 --- a/packages/suite-base/src/typings/i18next.d.ts +++ b/packages/suite-base/src/typings/i18next.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/index.d.ts b/packages/suite-base/src/typings/index.d.ts index d8e4089c9b..86c5853157 100644 --- a/packages/suite-base/src/typings/index.d.ts +++ b/packages/suite-base/src/typings/index.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/leaflet-ellipse.d.ts b/packages/suite-base/src/typings/leaflet-ellipse.d.ts index 3e7cc30271..a7bd78d725 100644 --- a/packages/suite-base/src/typings/leaflet-ellipse.d.ts +++ b/packages/suite-base/src/typings/leaflet-ellipse.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/overrides.d.ts b/packages/suite-base/src/typings/overrides.d.ts index eff9120b9e..ce8a910748 100644 --- a/packages/suite-base/src/typings/overrides.d.ts +++ b/packages/suite-base/src/typings/overrides.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/react.d.ts b/packages/suite-base/src/typings/react.d.ts index 710f338dd0..608602598a 100644 --- a/packages/suite-base/src/typings/react.d.ts +++ b/packages/suite-base/src/typings/react.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/typings/webpack-defines.d.ts b/packages/suite-base/src/typings/webpack-defines.d.ts index c4cd4608bb..b9540cd4af 100644 --- a/packages/suite-base/src/typings/webpack-defines.d.ts +++ b/packages/suite-base/src/typings/webpack-defines.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/BrowserHttpReader.ts b/packages/suite-base/src/util/BrowserHttpReader.ts index 25263cfd82..c6ef889ba8 100644 --- a/packages/suite-base/src/util/BrowserHttpReader.ts +++ b/packages/suite-base/src/util/BrowserHttpReader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/CachedFilelike.test.ts b/packages/suite-base/src/util/CachedFilelike.test.ts index a0ba405f88..b6291d2a76 100644 --- a/packages/suite-base/src/util/CachedFilelike.test.ts +++ b/packages/suite-base/src/util/CachedFilelike.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/CachedFilelike.ts b/packages/suite-base/src/util/CachedFilelike.ts index 40caab4a4d..b3a0435aac 100644 --- a/packages/suite-base/src/util/CachedFilelike.ts +++ b/packages/suite-base/src/util/CachedFilelike.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,10 +13,10 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import Logger from "@lichtblick/log"; +import { Filelike } from "@foxglove/rosbag"; import * as _ from "lodash-es"; -import { Filelike } from "@foxglove/rosbag"; +import Logger from "@lichtblick/log"; import VirtualLRUBuffer from "./VirtualLRUBuffer"; import { getNewConnection } from "./getNewConnection"; @@ -78,7 +81,7 @@ export default class CachedFilelike implements Filelike { #virtualBuffer: VirtualLRUBuffer; #log: ILogger; #closed: boolean = false; - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters #keepReconnectingCallback?: (reconnecting: boolean) => void; // The current active connection, if there is one. `remainingRange.start` gets updated whenever @@ -103,7 +106,7 @@ export default class CachedFilelike implements Filelike { fileReader: FileReader; cacheSizeInBytes?: number; log?: ILogger; - // eslint-disable-next-line @foxglove/no-boolean-parameters + // eslint-disable-next-line @lichtblick/no-boolean-parameters keepReconnectingCallback?: (reconnecting: boolean) => void; }) { this.#fileReader = options.fileReader; diff --git a/packages/suite-base/src/util/FetchReader.ts b/packages/suite-base/src/util/FetchReader.ts index 006201d1de..16582563b6 100644 --- a/packages/suite-base/src/util/FetchReader.ts +++ b/packages/suite-base/src/util/FetchReader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/Pose.ts b/packages/suite-base/src/util/Pose.ts index ecf9f8daeb..418bdea7a5 100644 --- a/packages/suite-base/src/util/Pose.ts +++ b/packages/suite-base/src/util/Pose.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/Rpc.test.ts b/packages/suite-base/src/util/Rpc.test.ts index 1204a1c813..fb46689ff6 100644 --- a/packages/suite-base/src/util/Rpc.test.ts +++ b/packages/suite-base/src/util/Rpc.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/Rpc.ts b/packages/suite-base/src/util/Rpc.ts index a841d9b080..b72718800e 100644 --- a/packages/suite-base/src/util/Rpc.ts +++ b/packages/suite-base/src/util/Rpc.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/RpcMainThreadUtils.ts b/packages/suite-base/src/util/RpcMainThreadUtils.ts index c78c0c153c..824599cb80 100644 --- a/packages/suite-base/src/util/RpcMainThreadUtils.ts +++ b/packages/suite-base/src/util/RpcMainThreadUtils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/RpcUtils.test.ts b/packages/suite-base/src/util/RpcUtils.test.ts index 6770c33dcc..13de736007 100644 --- a/packages/suite-base/src/util/RpcUtils.test.ts +++ b/packages/suite-base/src/util/RpcUtils.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/RpcWorkerUtils.ts b/packages/suite-base/src/util/RpcWorkerUtils.ts index 4ef7ad65eb..4267ca3dde 100644 --- a/packages/suite-base/src/util/RpcWorkerUtils.ts +++ b/packages/suite-base/src/util/RpcWorkerUtils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/VirtualLRUBuffer.test.ts b/packages/suite-base/src/util/VirtualLRUBuffer.test.ts index 0e613dea0c..e006f5d1b5 100644 --- a/packages/suite-base/src/util/VirtualLRUBuffer.test.ts +++ b/packages/suite-base/src/util/VirtualLRUBuffer.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/VirtualLRUBuffer.ts b/packages/suite-base/src/util/VirtualLRUBuffer.ts index 59005b88ad..91d1d9e170 100644 --- a/packages/suite-base/src/util/VirtualLRUBuffer.ts +++ b/packages/suite-base/src/util/VirtualLRUBuffer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/WebWorkerManager.test.ts b/packages/suite-base/src/util/WebWorkerManager.test.ts index f1c3e5c255..c75a78e347 100644 --- a/packages/suite-base/src/util/WebWorkerManager.test.ts +++ b/packages/suite-base/src/util/WebWorkerManager.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/WebWorkerManager.ts b/packages/suite-base/src/util/WebWorkerManager.ts index b3821be5cc..9638be8e61 100644 --- a/packages/suite-base/src/util/WebWorkerManager.ts +++ b/packages/suite-base/src/util/WebWorkerManager.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; + import Rpc, { Channel } from "@lichtblick/suite-base/util/Rpc"; import { setupMainThreadRpc } from "@lichtblick/suite-base/util/RpcMainThreadUtils"; -import * as _ from "lodash-es"; // This file provides a convenient way to set up and tear down workers as needed. It will create only a single worker // of each class, and terminate the worker when all listeners are unregistered. diff --git a/packages/suite-base/src/util/appURLState.test.ts b/packages/suite-base/src/util/appURLState.test.ts index 4f0617c1c9..83e1545b1d 100644 --- a/packages/suite-base/src/util/appURLState.test.ts +++ b/packages/suite-base/src/util/appURLState.test.ts @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { Time, toRFC3339String } from "@foxglove/rostime"; + import { AppURLState, updateAppURLState, @@ -9,8 +14,6 @@ import { } from "@lichtblick/suite-base/util/appURLState"; import isDesktopApp from "@lichtblick/suite-base/util/isDesktopApp"; -import { Time, toRFC3339String } from "@foxglove/rostime"; - jest.mock("@lichtblick/suite-base/util/isDesktopApp", () => ({ __esModule: true, default: jest.fn(), diff --git a/packages/suite-base/src/util/appURLState.ts b/packages/suite-base/src/util/appURLState.ts index e4dfb36321..2c0b4dc540 100644 --- a/packages/suite-base/src/util/appURLState.ts +++ b/packages/suite-base/src/util/appURLState.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; +import { Time, fromRFC3339String, toRFC3339String } from "@foxglove/rostime"; import * as _ from "lodash-es"; -import { Time, fromRFC3339String, toRFC3339String } from "@foxglove/rostime"; +import { LayoutID } from "@lichtblick/suite-base/context/CurrentLayoutContext"; export type AppURLState = { ds?: string; diff --git a/packages/suite-base/src/util/assertNever.ts b/packages/suite-base/src/util/assertNever.ts index d6ff23791e..d67f506ca7 100644 --- a/packages/suite-base/src/util/assertNever.ts +++ b/packages/suite-base/src/util/assertNever.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/bagConnectionsHelper.test.ts b/packages/suite-base/src/util/bagConnectionsHelper.test.ts index 7adc189a4f..26dd4eb613 100644 --- a/packages/suite-base/src/util/bagConnectionsHelper.test.ts +++ b/packages/suite-base/src/util/bagConnectionsHelper.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/bagConnectionsHelper.ts b/packages/suite-base/src/util/bagConnectionsHelper.ts index 0168e54bc4..b8e63945fb 100644 --- a/packages/suite-base/src/util/bagConnectionsHelper.ts +++ b/packages/suite-base/src/util/bagConnectionsHelper.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; - import { parse as parseMessageDefinition } from "@foxglove/rosmsg"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; + type DatatypeDescription = { messageDefinition: string; type: string; diff --git a/packages/suite-base/src/util/bags.test.ts b/packages/suite-base/src/util/bags.test.ts index b2cbba7da0..5b819d2c2a 100644 --- a/packages/suite-base/src/util/bags.test.ts +++ b/packages/suite-base/src/util/bags.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import permutations from "@lichtblick/suite-base/test/permutations"; - import { Time, fromSec } from "@foxglove/rostime"; +import permutations from "@lichtblick/suite-base/test/permutations"; + import { getBagChunksOverlapCount } from "./bags"; const expectChunkOverlaps = ( diff --git a/packages/suite-base/src/util/bags.ts b/packages/suite-base/src/util/bags.ts index cb3afa2691..9155590d2a 100644 --- a/packages/suite-base/src/util/bags.ts +++ b/packages/suite-base/src/util/bags.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/basicDatatypes.ts b/packages/suite-base/src/util/basicDatatypes.ts index 6b2529a9f8..93f132d125 100644 --- a/packages/suite-base/src/util/basicDatatypes.ts +++ b/packages/suite-base/src/util/basicDatatypes.ts @@ -1,12 +1,15 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; - import { ros1, ros2galactic } from "@foxglove/rosmsg-msgs-common"; import { foxgloveMessageSchemas, generateRosMsgDefinition } from "@foxglove/schemas/internal"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; + /** * basicDatatypes is a map containing definitions for ROS common datatypes and foxglove datatypes * from the following packages: diff --git a/packages/suite-base/src/util/clipboard.ts b/packages/suite-base/src/util/clipboard.ts index 5ce1160b41..33e4819afc 100644 --- a/packages/suite-base/src/util/clipboard.ts +++ b/packages/suite-base/src/util/clipboard.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/colorUtils.ts b/packages/suite-base/src/util/colorUtils.ts index 93a66bbbd2..ecf1ac6aa8 100644 --- a/packages/suite-base/src/util/colorUtils.ts +++ b/packages/suite-base/src/util/colorUtils.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/concatAndTruncate.test.ts b/packages/suite-base/src/util/concatAndTruncate.test.ts index 711892cd1a..9ba9bf596f 100644 --- a/packages/suite-base/src/util/concatAndTruncate.test.ts +++ b/packages/suite-base/src/util/concatAndTruncate.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/concatAndTruncate.ts b/packages/suite-base/src/util/concatAndTruncate.ts index d7a089c09b..52ec0b1605 100644 --- a/packages/suite-base/src/util/concatAndTruncate.ts +++ b/packages/suite-base/src/util/concatAndTruncate.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/delay.ts b/packages/suite-base/src/util/delay.ts index 1a2b441000..97107fd5aa 100644 --- a/packages/suite-base/src/util/delay.ts +++ b/packages/suite-base/src/util/delay.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/download.ts b/packages/suite-base/src/util/download.ts index c525169e93..6b9ff92a2e 100644 --- a/packages/suite-base/src/util/download.ts +++ b/packages/suite-base/src/util/download.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/enums.test.ts b/packages/suite-base/src/util/enums.test.ts index 60e5cdfa2c..ea756ded46 100644 --- a/packages/suite-base/src/util/enums.test.ts +++ b/packages/suite-base/src/util/enums.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/enums.ts b/packages/suite-base/src/util/enums.ts index ac23edf490..fdbd29d4e1 100644 --- a/packages/suite-base/src/util/enums.ts +++ b/packages/suite-base/src/util/enums.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/errors.test.ts b/packages/suite-base/src/util/errors.test.ts index ff2e4216f3..0248f73a5e 100644 --- a/packages/suite-base/src/util/errors.test.ts +++ b/packages/suite-base/src/util/errors.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/errors.ts b/packages/suite-base/src/util/errors.ts index 1ea1677c11..cada8460c2 100644 --- a/packages/suite-base/src/util/errors.ts +++ b/packages/suite-base/src/util/errors.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/formatKeyboardShortcut.test.ts b/packages/suite-base/src/util/formatKeyboardShortcut.test.ts index c8f3b352b1..13654c6e82 100644 --- a/packages/suite-base/src/util/formatKeyboardShortcut.test.ts +++ b/packages/suite-base/src/util/formatKeyboardShortcut.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/formatKeyboardShortcut.ts b/packages/suite-base/src/util/formatKeyboardShortcut.ts index 8aaab1d817..52ef283f93 100644 --- a/packages/suite-base/src/util/formatKeyboardShortcut.ts +++ b/packages/suite-base/src/util/formatKeyboardShortcut.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/formatTime.test.ts b/packages/suite-base/src/util/formatTime.test.ts index 51c42e4039..7b246f83cc 100644 --- a/packages/suite-base/src/util/formatTime.test.ts +++ b/packages/suite-base/src/util/formatTime.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/formatTime.ts b/packages/suite-base/src/util/formatTime.ts index d5697b3d83..b53fa3f1f1 100644 --- a/packages/suite-base/src/util/formatTime.ts +++ b/packages/suite-base/src/util/formatTime.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,11 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; +import { Time, toDate, fromDate } from "@foxglove/rostime"; import momentDurationFormatSetup from "moment-duration-format"; import moment from "moment-timezone"; -import { Time, toDate, fromDate } from "@foxglove/rostime"; +import { TimeDisplayMethod } from "@lichtblick/suite-base/types/panels"; import parseFuzzyRosTime from "./parseFuzzyRosTime"; diff --git a/packages/suite-base/src/util/fuzzyFilter.test.ts b/packages/suite-base/src/util/fuzzyFilter.test.ts index 380bb866bc..16163b68e2 100644 --- a/packages/suite-base/src/util/fuzzyFilter.test.ts +++ b/packages/suite-base/src/util/fuzzyFilter.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/fuzzyFilter.ts b/packages/suite-base/src/util/fuzzyFilter.ts index d391d3ad26..1169e67fe8 100644 --- a/packages/suite-base/src/util/fuzzyFilter.ts +++ b/packages/suite-base/src/util/fuzzyFilter.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/geometry.ts b/packages/suite-base/src/util/geometry.ts index bee51989c0..e9c012906d 100644 --- a/packages/suite-base/src/util/geometry.ts +++ b/packages/suite-base/src/util/geometry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/getItemString.tsx b/packages/suite-base/src/util/getItemString.tsx index 784d1daf4e..57f2354a1f 100644 --- a/packages/suite-base/src/util/getItemString.tsx +++ b/packages/suite-base/src/util/getItemString.tsx @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { ReactNode } from "react"; +import tinycolor from "tinycolor2"; + import { filterMap } from "@lichtblick/den/collection"; import { isTypicalFilterName } from "@lichtblick/suite-base/components/MessagePathSyntax/isTypicalFilterName"; import { format, formatDuration } from "@lichtblick/suite-base/util/formatTime"; import { quatToEuler } from "@lichtblick/suite-base/util/quatToEuler"; -import { ReactNode } from "react"; -import tinycolor from "tinycolor2"; const DURATION_20_YEARS_SEC = 20 * 365 * 24 * 60 * 60; diff --git a/packages/suite-base/src/util/getNewConnection.test.ts b/packages/suite-base/src/util/getNewConnection.test.ts index f18ce9c6eb..9b1551b228 100644 --- a/packages/suite-base/src/util/getNewConnection.test.ts +++ b/packages/suite-base/src/util/getNewConnection.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/getNewConnection.ts b/packages/suite-base/src/util/getNewConnection.ts index 684100b5db..29379e7490 100644 --- a/packages/suite-base/src/util/getNewConnection.ts +++ b/packages/suite-base/src/util/getNewConnection.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/globalConstants.ts b/packages/suite-base/src/util/globalConstants.ts index 5f5fba771c..6826fe29b1 100644 --- a/packages/suite-base/src/util/globalConstants.ts +++ b/packages/suite-base/src/util/globalConstants.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/installDevtoolsFormatters.ts b/packages/suite-base/src/util/installDevtoolsFormatters.ts index 0624b7ed8a..69c7a6064f 100644 --- a/packages/suite-base/src/util/installDevtoolsFormatters.ts +++ b/packages/suite-base/src/util/installDevtoolsFormatters.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -14,10 +17,10 @@ // Custom formatters for Chrome dev tools. See documentation: http://bit.ly/object-formatters // Note that the "Enable custom formatters" setting must be turned on in order to use these formatters. -import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; +import { isTime } from "@foxglove/rostime"; import seedrandom from "seedrandom"; -import { isTime } from "@foxglove/rostime"; +import { mightActuallyBePartial } from "@lichtblick/suite-base/util/mightActuallyBePartial"; type HtmlTemplate = unknown; type DevtoolFormatterConfig = { diff --git a/packages/suite-base/src/util/isDesktopApp.ts b/packages/suite-base/src/util/isDesktopApp.ts index bc032266c9..9f844e920c 100644 --- a/packages/suite-base/src/util/isDesktopApp.ts +++ b/packages/suite-base/src/util/isDesktopApp.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/layout.test.ts b/packages/suite-base/src/util/layout.test.ts index d8a18cc6eb..477c4d899c 100644 --- a/packages/suite-base/src/util/layout.test.ts +++ b/packages/suite-base/src/util/layout.test.ts @@ -1,4 +1,7 @@ /** @jest-environment jsdom */ + +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { TabPanelConfig } from "@lichtblick/suite-base/types/layouts"; import { getNodeAtPath, MosaicNode, MosaicParent, updateTree } from "react-mosaic-component"; +import { TabPanelConfig } from "@lichtblick/suite-base/types/layouts"; + import { getPanelTypeFromId, getSaveConfigsPayloadForAddedPanel, diff --git a/packages/suite-base/src/util/layout.ts b/packages/suite-base/src/util/layout.ts index 3cbbcfb548..57189edfbf 100644 --- a/packages/suite-base/src/util/layout.ts +++ b/packages/suite-base/src/util/layout.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -10,6 +13,19 @@ // This source code is licensed under the Apache License, Version 2.0, // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. +import * as _ from "lodash-es"; +import { + createRemoveUpdate, + getLeaves, + getNodeAtPath, + updateTree, + MosaicUpdate, + isParent, + MosaicNode, + MosaicPath, +} from "react-mosaic-component"; +import { MosaicDirection, MosaicKey } from "react-mosaic-component/lib/types"; + import { filterMap } from "@lichtblick/den/collection"; import Logger from "@lichtblick/log"; import { @@ -24,18 +40,6 @@ import { SavedProps, } from "@lichtblick/suite-base/types/panels"; import { TAB_PANEL_TYPE } from "@lichtblick/suite-base/util/globalConstants"; -import * as _ from "lodash-es"; -import { - createRemoveUpdate, - getLeaves, - getNodeAtPath, - updateTree, - MosaicUpdate, - isParent, - MosaicNode, - MosaicPath, -} from "react-mosaic-component"; -import { MosaicDirection, MosaicKey } from "react-mosaic-component/lib/types"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-base/src/util/makeMockAppConfiguration.ts b/packages/suite-base/src/util/makeMockAppConfiguration.ts index 88541dd689..c9f7af860a 100644 --- a/packages/suite-base/src/util/makeMockAppConfiguration.ts +++ b/packages/suite-base/src/util/makeMockAppConfiguration.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/maybeCast.ts b/packages/suite-base/src/util/maybeCast.ts index 51d690e822..eb33d34323 100644 --- a/packages/suite-base/src/util/maybeCast.ts +++ b/packages/suite-base/src/util/maybeCast.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/mightActuallyBePartial.ts b/packages/suite-base/src/util/mightActuallyBePartial.ts index 153336b68d..04a819bc0b 100644 --- a/packages/suite-base/src/util/mightActuallyBePartial.ts +++ b/packages/suite-base/src/util/mightActuallyBePartial.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/naturalSort.test.ts b/packages/suite-base/src/util/naturalSort.test.ts index e742a6e90d..52b0da357c 100644 --- a/packages/suite-base/src/util/naturalSort.test.ts +++ b/packages/suite-base/src/util/naturalSort.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/naturalSort.ts b/packages/suite-base/src/util/naturalSort.ts index ff92ca916b..fc393925da 100644 --- a/packages/suite-base/src/util/naturalSort.ts +++ b/packages/suite-base/src/util/naturalSort.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/overwriteFetch.test.ts b/packages/suite-base/src/util/overwriteFetch.test.ts index 9ce2805e11..d9c1c0d445 100644 --- a/packages/suite-base/src/util/overwriteFetch.test.ts +++ b/packages/suite-base/src/util/overwriteFetch.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/overwriteFetch.ts b/packages/suite-base/src/util/overwriteFetch.ts index 22cd99c45a..116ac663f1 100644 --- a/packages/suite-base/src/util/overwriteFetch.ts +++ b/packages/suite-base/src/util/overwriteFetch.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/parseFuzzyRosTime.test.ts b/packages/suite-base/src/util/parseFuzzyRosTime.test.ts index ab6bfb85f0..0c4c5de8a6 100644 --- a/packages/suite-base/src/util/parseFuzzyRosTime.test.ts +++ b/packages/suite-base/src/util/parseFuzzyRosTime.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/parseFuzzyRosTime.ts b/packages/suite-base/src/util/parseFuzzyRosTime.ts index 707dfe7d98..127e347e37 100644 --- a/packages/suite-base/src/util/parseFuzzyRosTime.ts +++ b/packages/suite-base/src/util/parseFuzzyRosTime.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/plotColors.ts b/packages/suite-base/src/util/plotColors.ts index 3df520f7fc..875037fa2f 100644 --- a/packages/suite-base/src/util/plotColors.ts +++ b/packages/suite-base/src/util/plotColors.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,11 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { toolsColorScheme } from "@lichtblick/suite-base/util/toolsColorScheme"; import * as _ from "lodash-es"; import tinycolor from "tinycolor2"; +import { toolsColorScheme } from "@lichtblick/suite-base/util/toolsColorScheme"; + // Inspired by the "light" scheme from https://personal.sron.nl/~pault/#sec:qualitative // but using our standard tools colors. export const lineColors = [ diff --git a/packages/suite-base/src/util/process.ts b/packages/suite-base/src/util/process.ts index 637d866f27..8617216d64 100644 --- a/packages/suite-base/src/util/process.ts +++ b/packages/suite-base/src/util/process.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/quatToEuler.ts b/packages/suite-base/src/util/quatToEuler.ts index 375c8e353e..9297ee87f0 100644 --- a/packages/suite-base/src/util/quatToEuler.ts +++ b/packages/suite-base/src/util/quatToEuler.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/ranges.test.ts b/packages/suite-base/src/util/ranges.test.ts index b4ad7c235c..31d976d922 100644 --- a/packages/suite-base/src/util/ranges.test.ts +++ b/packages/suite-base/src/util/ranges.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/ranges.ts b/packages/suite-base/src/util/ranges.ts index 244c70e741..f4b8914c84 100644 --- a/packages/suite-base/src/util/ranges.ts +++ b/packages/suite-base/src/util/ranges.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/rosDatatypesToMessageDefinition.ts b/packages/suite-base/src/util/rosDatatypesToMessageDefinition.ts index 39c3fd50f9..5b854ae9b7 100644 --- a/packages/suite-base/src/util/rosDatatypesToMessageDefinition.ts +++ b/packages/suite-base/src/util/rosDatatypesToMessageDefinition.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,10 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; - import { MessageDefinition } from "@foxglove/message-definition"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; + // For one datatype in the datatypes, find the MessageDefinition that we can use // to either write or parse it. `datatypes` should contain the root datatype and // all complex sub-datatypes. diff --git a/packages/suite-base/src/util/rosDatatypesToMessageDefinitions.test.ts b/packages/suite-base/src/util/rosDatatypesToMessageDefinitions.test.ts index 114997f808..726aec2244 100644 --- a/packages/suite-base/src/util/rosDatatypesToMessageDefinitions.test.ts +++ b/packages/suite-base/src/util/rosDatatypesToMessageDefinitions.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -11,9 +14,10 @@ // found at http://www.apache.org/licenses/LICENSE-2.0 // You may not use this file except in compliance with the License. -import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; import * as _ from "lodash-es"; +import { RosDatatypes } from "@lichtblick/suite-base/types/RosDatatypes"; + import { basicDatatypes } from "./basicDatatypes"; import rosDatatypesToMessageDefinition from "./rosDatatypesToMessageDefinition"; diff --git a/packages/suite-base/src/util/sendNotification.ts b/packages/suite-base/src/util/sendNotification.ts index 4ee13b32f9..cdd84aafa8 100644 --- a/packages/suite-base/src/util/sendNotification.ts +++ b/packages/suite-base/src/util/sendNotification.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -17,10 +20,11 @@ // its unavoidable to bail out with a generic error message (e.g. when dragging in a malformed // ROS bag). +import { ReactNode } from "react"; + import { reportError } from "@lichtblick/suite-base/reportError"; import { AppError } from "@lichtblick/suite-base/util/errors"; import { inWebWorker } from "@lichtblick/suite-base/util/workers"; -import { ReactNode } from "react"; export type NotificationType = "app" | "user"; export type DetailsType = string | Error | ReactNode; diff --git a/packages/suite-base/src/util/setImmediate.ts b/packages/suite-base/src/util/setImmediate.ts index 2b9099aa6c..d299418f99 100644 --- a/packages/suite-base/src/util/setImmediate.ts +++ b/packages/suite-base/src/util/setImmediate.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/showOpenFilePicker.tsx b/packages/suite-base/src/util/showOpenFilePicker.tsx index 4be6995d18..e32a4febaf 100644 --- a/packages/suite-base/src/util/showOpenFilePicker.tsx +++ b/packages/suite-base/src/util/showOpenFilePicker.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/strPack.test.ts b/packages/suite-base/src/util/strPack.test.ts index 8e905fd9a2..8ab8a66a32 100644 --- a/packages/suite-base/src/util/strPack.test.ts +++ b/packages/suite-base/src/util/strPack.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/strPack.ts b/packages/suite-base/src/util/strPack.ts index eca851aaf7..7e88169fb8 100644 --- a/packages/suite-base/src/util/strPack.ts +++ b/packages/suite-base/src/util/strPack.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/time.test.ts b/packages/suite-base/src/util/time.test.ts index cc7049927a..d3acd15310 100644 --- a/packages/suite-base/src/util/time.test.ts +++ b/packages/suite-base/src/util/time.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/time.ts b/packages/suite-base/src/util/time.ts index 4119e389a2..d48a101190 100644 --- a/packages/suite-base/src/util/time.ts +++ b/packages/suite-base/src/util/time.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -12,12 +15,12 @@ // You may not use this file except in compliance with the License. // No time functions that require `moment` should live in this file. +import { Time } from "@foxglove/rostime"; + import log from "@lichtblick/log"; import { MessageEvent } from "@lichtblick/suite-base/players/types"; import { MarkerArray, StampedMessage } from "@lichtblick/suite-base/types/Messages"; -import { Time } from "@foxglove/rostime"; - export type TimestampMethod = "receiveTime" | "headerStamp"; export function formatTimeRaw(stamp: Time): string { diff --git a/packages/suite-base/src/util/toggle.test.ts b/packages/suite-base/src/util/toggle.test.ts index 457fe306ee..e9a105dc33 100644 --- a/packages/suite-base/src/util/toggle.test.ts +++ b/packages/suite-base/src/util/toggle.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/toggle.ts b/packages/suite-base/src/util/toggle.ts index 5e231dd3c2..1f1ee47036 100644 --- a/packages/suite-base/src/util/toggle.ts +++ b/packages/suite-base/src/util/toggle.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/toolsColorScheme.ts b/packages/suite-base/src/util/toolsColorScheme.ts index d63cbafeb1..1d150aaf9c 100644 --- a/packages/suite-base/src/util/toolsColorScheme.ts +++ b/packages/suite-base/src/util/toolsColorScheme.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/validators.ts b/packages/suite-base/src/util/validators.ts index 23088410cb..36e8709fd9 100644 --- a/packages/suite-base/src/util/validators.ts +++ b/packages/suite-base/src/util/validators.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/waitForFonts.ts b/packages/suite-base/src/util/waitForFonts.ts index 5558cd2f28..f62db19bcc 100644 --- a/packages/suite-base/src/util/waitForFonts.ts +++ b/packages/suite-base/src/util/waitForFonts.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/workers.test.ts b/packages/suite-base/src/util/workers.test.ts index 7f328913f9..863d8f5564 100644 --- a/packages/suite-base/src/util/workers.test.ts +++ b/packages/suite-base/src/util/workers.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/src/util/workers.ts b/packages/suite-base/src/util/workers.ts index 0f561cfae5..66877af425 100644 --- a/packages/suite-base/src/util/workers.ts +++ b/packages/suite-base/src/util/workers.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-base/webpack.ts b/packages/suite-base/webpack.ts index 4039879e87..ded5e02cec 100644 --- a/packages/suite-base/webpack.ts +++ b/packages/suite-base/webpack.ts @@ -1,7 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { createTssReactNameTransformer } from "@foxglove/typescript-transformers"; import { ESBuildMinifyPlugin } from "esbuild-loader"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import monacoPkg from "monaco-editor/package.json"; @@ -11,8 +15,6 @@ import ReactRefreshTypescript from "react-refresh-typescript"; import ts from "typescript"; import webpack, { Configuration } from "webpack"; -import { createTssReactNameTransformer } from "@foxglove/typescript-transformers"; - import { WebpackArgv } from "./WebpackArgv"; if (monacoPkg.version !== "0.40.0") { diff --git a/packages/suite-desktop/src/WebpackConfigParams.ts b/packages/suite-desktop/src/WebpackConfigParams.ts index f3dd413c69..7a6cffcdad 100644 --- a/packages/suite-desktop/src/WebpackConfigParams.ts +++ b/packages/suite-desktop/src/WebpackConfigParams.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/afterPack.ts b/packages/suite-desktop/src/afterPack.ts index 044b120280..65e18b079a 100644 --- a/packages/suite-desktop/src/afterPack.ts +++ b/packages/suite-desktop/src/afterPack.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/common/rendererArgs.test.ts b/packages/suite-desktop/src/common/rendererArgs.test.ts index 230d6ea917..94f80cc4e9 100644 --- a/packages/suite-desktop/src/common/rendererArgs.test.ts +++ b/packages/suite-desktop/src/common/rendererArgs.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/common/rendererArgs.ts b/packages/suite-desktop/src/common/rendererArgs.ts index b9ad3882d4..a97477720c 100644 --- a/packages/suite-desktop/src/common/rendererArgs.ts +++ b/packages/suite-desktop/src/common/rendererArgs.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/common/storage.ts b/packages/suite-desktop/src/common/storage.ts index fd33089cd9..41f2cda256 100644 --- a/packages/suite-desktop/src/common/storage.ts +++ b/packages/suite-desktop/src/common/storage.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/common/types.ts b/packages/suite-desktop/src/common/types.ts index f057b99487..4cd620a9c5 100644 --- a/packages/suite-desktop/src/common/types.ts +++ b/packages/suite-desktop/src/common/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/common/webpackDefines.ts b/packages/suite-desktop/src/common/webpackDefines.ts index 583fac1a3e..5c2fbe03a3 100644 --- a/packages/suite-desktop/src/common/webpackDefines.ts +++ b/packages/suite-desktop/src/common/webpackDefines.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/electronBuilderConfig.js b/packages/suite-desktop/src/electronBuilderConfig.js index 987ecb6db9..f7bd707f01 100644 --- a/packages/suite-desktop/src/electronBuilderConfig.js +++ b/packages/suite-desktop/src/electronBuilderConfig.js @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/main/StudioAppUpdater.ts b/packages/suite-desktop/src/main/StudioAppUpdater.ts index a813d68089..52b42baeee 100644 --- a/packages/suite-desktop/src/main/StudioAppUpdater.ts +++ b/packages/suite-desktop/src/main/StudioAppUpdater.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; import { dialog } from "electron"; import { autoUpdater, UpdateInfo } from "electron-updater"; import { EventEmitter } from "eventemitter3"; +import Logger from "@lichtblick/log"; +import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; + import { getAppSetting } from "./settings"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-desktop/src/main/StudioWindow.ts b/packages/suite-desktop/src/main/StudioWindow.ts index f4abb3936c..2605b3a5b1 100644 --- a/packages/suite-desktop/src/main/StudioWindow.ts +++ b/packages/suite-desktop/src/main/StudioWindow.ts @@ -1,12 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /// -import Logger from "@lichtblick/log"; -import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/src/components/AppBar/constants"; -import { NativeAppMenuEvent } from "@lichtblick/suite-base/src/context/NativeAppMenuContext"; +import { palette } from "@foxglove/theme"; import { BrowserWindow, BrowserWindowConstructorOptions, @@ -22,7 +23,9 @@ import { import i18n, { t } from "i18next"; import path from "path"; -import { palette } from "@foxglove/theme"; +import Logger from "@lichtblick/log"; +import { APP_BAR_HEIGHT } from "@lichtblick/suite-base/src/components/AppBar/constants"; +import { NativeAppMenuEvent } from "@lichtblick/suite-base/src/context/NativeAppMenuContext"; import StudioAppUpdater from "./StudioAppUpdater"; import getDevModeIcon from "./getDevModeIcon"; diff --git a/packages/suite-desktop/src/main/getDevModeIcon.ts b/packages/suite-desktop/src/main/getDevModeIcon.ts index b9fea717a3..a3ed36779f 100644 --- a/packages/suite-desktop/src/main/getDevModeIcon.ts +++ b/packages/suite-desktop/src/main/getDevModeIcon.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/main/index.ts b/packages/suite-desktop/src/main/index.ts index 04b6c44e86..5b7ff9ccc7 100644 --- a/packages/suite-desktop/src/main/index.ts +++ b/packages/suite-desktop/src/main/index.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; import { app, BrowserWindow, ipcMain, Menu, nativeTheme, session } from "electron"; import fs from "fs"; import i18n from "i18next"; +import Logger from "@lichtblick/log"; +import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; + import StudioAppUpdater from "./StudioAppUpdater"; import StudioWindow from "./StudioWindow"; import getDevModeIcon from "./getDevModeIcon"; diff --git a/packages/suite-desktop/src/main/injectFilesToOpen.ts b/packages/suite-desktop/src/main/injectFilesToOpen.ts index 84c074a607..74f7ca658a 100644 --- a/packages/suite-desktop/src/main/injectFilesToOpen.ts +++ b/packages/suite-desktop/src/main/injectFilesToOpen.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { Debugger, dialog } from "electron"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); /* diff --git a/packages/suite-desktop/src/main/installChromeExtensions.ts b/packages/suite-desktop/src/main/installChromeExtensions.ts index 261adf0783..e254059362 100644 --- a/packages/suite-desktop/src/main/installChromeExtensions.ts +++ b/packages/suite-desktop/src/main/installChromeExtensions.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import installExtension, { REACT_DEVELOPER_TOOLS } from "electron-devtools-installer"; + import { PromiseTimeoutError, promiseTimeout } from "@lichtblick/den/async"; import Logger from "@lichtblick/log"; -import installExtension, { REACT_DEVELOPER_TOOLS } from "electron-devtools-installer"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-desktop/src/main/rosPackageResources.test.ts b/packages/suite-desktop/src/main/rosPackageResources.test.ts index 8dd2a0a890..dc12c2434d 100644 --- a/packages/suite-desktop/src/main/rosPackageResources.test.ts +++ b/packages/suite-desktop/src/main/rosPackageResources.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/main/rosPackageResources.ts b/packages/suite-desktop/src/main/rosPackageResources.ts index 3a05bab69d..af3ead7efd 100644 --- a/packages/suite-desktop/src/main/rosPackageResources.ts +++ b/packages/suite-desktop/src/main/rosPackageResources.ts @@ -1,8 +1,9 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; import { DOMParser } from "@xmldom/xmldom"; import { protocol } from "electron"; import { promises as fs } from "fs"; @@ -10,6 +11,9 @@ import path from "path"; import { PNG } from "pngjs"; import UTIF from "utif"; +import Logger from "@lichtblick/log"; +import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; + import { getAppSetting } from "./settings"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-desktop/src/main/settings.ts b/packages/suite-desktop/src/main/settings.ts index 257dc88c9e..78b392563b 100644 --- a/packages/suite-desktop/src/main/settings.ts +++ b/packages/suite-desktop/src/main/settings.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; import { app } from "electron"; import fs from "fs"; import path from "path"; +import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; + import { DATASTORES_DIR_NAME, SETTINGS_DATASTORE_NAME, diff --git a/packages/suite-desktop/src/main/simulateUserClick.ts b/packages/suite-desktop/src/main/simulateUserClick.ts index cf24ae6909..b00a3587f8 100644 --- a/packages/suite-desktop/src/main/simulateUserClick.ts +++ b/packages/suite-desktop/src/main/simulateUserClick.ts @@ -1,10 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import delay from "@lichtblick/suite-base/src/util/delay"; import { BrowserWindow } from "electron"; +import delay from "@lichtblick/suite-base/src/util/delay"; + // elements can only be opened on user interaction // This fakes a uesr interaction which allows us to invoke input.click() in renderer threads export async function simulateUserClick(win: BrowserWindow): Promise { diff --git a/packages/suite-desktop/src/main/telemetry.ts b/packages/suite-desktop/src/main/telemetry.ts index f9731c8582..9134463a1d 100644 --- a/packages/suite-desktop/src/main/telemetry.ts +++ b/packages/suite-desktop/src/main/telemetry.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/preload/LocalFileStorage.ts b/packages/suite-desktop/src/preload/LocalFileStorage.ts index ccce6a57d9..a6a6ba29c3 100644 --- a/packages/suite-desktop/src/preload/LocalFileStorage.ts +++ b/packages/suite-desktop/src/preload/LocalFileStorage.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { ipcRenderer } from "electron"; import { promises as fs } from "fs"; import path from "path"; +import Logger from "@lichtblick/log"; + import { DATASTORES_DIR_NAME } from "../common/storage"; import type { Storage, StorageContent } from "../common/types"; diff --git a/packages/suite-desktop/src/preload/extensions.ts b/packages/suite-desktop/src/preload/extensions.ts index 65688fb608..503857474b 100644 --- a/packages/suite-desktop/src/preload/extensions.ts +++ b/packages/suite-desktop/src/preload/extensions.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { existsSync } from "fs"; import { mkdir, readdir, readFile, rm, writeFile } from "fs/promises"; import JSZip from "jszip"; import { dirname, join as pathJoin } from "path"; +import Logger from "@lichtblick/log"; + import { DesktopExtension } from "../common/types"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-desktop/src/preload/index.ts b/packages/suite-desktop/src/preload/index.ts index 4af82ce059..8431d93cc8 100644 --- a/packages/suite-desktop/src/preload/index.ts +++ b/packages/suite-desktop/src/preload/index.ts @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; -import { NetworkInterface, OsContext } from "@lichtblick/suite-base/src/OsContext"; +import { PreloaderSockets } from "@foxglove/electron-socket/preloader"; import { contextBridge, ipcRenderer } from "electron"; import os from "os"; import { join as pathJoin } from "path"; -import { PreloaderSockets } from "@foxglove/electron-socket/preloader"; +import Logger from "@lichtblick/log"; +import { NetworkInterface, OsContext } from "@lichtblick/suite-base/src/OsContext"; import LocalFileStorage from "./LocalFileStorage"; import { getExtensions, installExtension, loadExtension, uninstallExtension } from "./extensions"; diff --git a/packages/suite-desktop/src/preload/layouts.test.ts b/packages/suite-desktop/src/preload/layouts.test.ts index 413208c608..c655d02ba0 100644 --- a/packages/suite-desktop/src/preload/layouts.test.ts +++ b/packages/suite-desktop/src/preload/layouts.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/preload/layouts.ts b/packages/suite-desktop/src/preload/layouts.ts index d149469c86..44789d5816 100644 --- a/packages/suite-desktop/src/preload/layouts.ts +++ b/packages/suite-desktop/src/preload/layouts.ts @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import { existsSync } from "fs"; import { readdir, readFile } from "fs/promises"; import { join as pathJoin } from "path"; +import Logger from "@lichtblick/log"; + import { DesktopLayout } from "../common/types"; const log = Logger.getLogger(__filename); diff --git a/packages/suite-desktop/src/quicklook/FileInfoDisplay.stories.tsx b/packages/suite-desktop/src/quicklook/FileInfoDisplay.stories.tsx index 364d99ac5d..d42c4d3251 100644 --- a/packages/suite-desktop/src/quicklook/FileInfoDisplay.stories.tsx +++ b/packages/suite-desktop/src/quicklook/FileInfoDisplay.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/FileInfoDisplay.tsx b/packages/suite-desktop/src/quicklook/FileInfoDisplay.tsx index 17d085cddd..ed4835d722 100644 --- a/packages/suite-desktop/src/quicklook/FileInfoDisplay.tsx +++ b/packages/suite-desktop/src/quicklook/FileInfoDisplay.tsx @@ -1,14 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /// -import Logger from "@lichtblick/log"; +import { Time, toDate } from "@foxglove/rostime"; import { useEffect, useMemo } from "react"; import { makeStyles } from "tss-react/mui"; -import { Time, toDate } from "@foxglove/rostime"; +import Logger from "@lichtblick/log"; import Flash from "./Flash"; import formatByteSize from "./formatByteSize"; diff --git a/packages/suite-desktop/src/quicklook/Flash.tsx b/packages/suite-desktop/src/quicklook/Flash.tsx index 6977d175e3..2a11ec35de 100644 --- a/packages/suite-desktop/src/quicklook/Flash.tsx +++ b/packages/suite-desktop/src/quicklook/Flash.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/GlobalStyle.tsx b/packages/suite-desktop/src/quicklook/GlobalStyle.tsx index fb6c8d1cf8..dbc540228f 100644 --- a/packages/suite-desktop/src/quicklook/GlobalStyle.tsx +++ b/packages/suite-desktop/src/quicklook/GlobalStyle.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/StorybookDecorator.tsx b/packages/suite-desktop/src/quicklook/StorybookDecorator.tsx index b9091999eb..79c77db030 100644 --- a/packages/suite-desktop/src/quicklook/StorybookDecorator.tsx +++ b/packages/suite-desktop/src/quicklook/StorybookDecorator.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/extensions.d.ts b/packages/suite-desktop/src/quicklook/extensions.d.ts index 143533f502..c08a32d30c 100644 --- a/packages/suite-desktop/src/quicklook/extensions.d.ts +++ b/packages/suite-desktop/src/quicklook/extensions.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/formatByteSize.test.ts b/packages/suite-desktop/src/quicklook/formatByteSize.test.ts index b09830a188..863d1da6eb 100644 --- a/packages/suite-desktop/src/quicklook/formatByteSize.test.ts +++ b/packages/suite-desktop/src/quicklook/formatByteSize.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/formatByteSize.ts b/packages/suite-desktop/src/quicklook/formatByteSize.ts index e5a90bdf00..ca6a047f8c 100644 --- a/packages/suite-desktop/src/quicklook/formatByteSize.ts +++ b/packages/suite-desktop/src/quicklook/formatByteSize.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/getBagInfo.ts b/packages/suite-desktop/src/quicklook/getBagInfo.ts index dfbbb11a7b..46b189861f 100644 --- a/packages/suite-desktop/src/quicklook/getBagInfo.ts +++ b/packages/suite-desktop/src/quicklook/getBagInfo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/getIndexedMcapInfo.ts b/packages/suite-desktop/src/quicklook/getIndexedMcapInfo.ts index ee18db5fa7..0586b324a2 100644 --- a/packages/suite-desktop/src/quicklook/getIndexedMcapInfo.ts +++ b/packages/suite-desktop/src/quicklook/getIndexedMcapInfo.ts @@ -1,10 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { McapIndexedReader, McapTypes } from "@mcap/core"; - import { fromNanoSec } from "@foxglove/rostime"; +import { McapIndexedReader, McapTypes } from "@mcap/core"; import { FileInfo, TopicInfo } from "./types"; diff --git a/packages/suite-desktop/src/quicklook/getMcapInfo.test.ts b/packages/suite-desktop/src/quicklook/getMcapInfo.test.ts index de14678a4f..0dfc1d8995 100644 --- a/packages/suite-desktop/src/quicklook/getMcapInfo.test.ts +++ b/packages/suite-desktop/src/quicklook/getMcapInfo.test.ts @@ -1,12 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { TempBuffer } from "@foxglove/mcap-support"; import { McapWriter } from "@mcap/core"; import { Blob } from "node:buffer"; -import { TempBuffer } from "@foxglove/mcap-support"; - import { getMcapInfo } from "./getMcapInfo"; describe("getMcapInfo", () => { diff --git a/packages/suite-desktop/src/quicklook/getMcapInfo.ts b/packages/suite-desktop/src/quicklook/getMcapInfo.ts index 61920f4793..9635e836b1 100644 --- a/packages/suite-desktop/src/quicklook/getMcapInfo.ts +++ b/packages/suite-desktop/src/quicklook/getMcapInfo.ts @@ -1,11 +1,14 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; +import { loadDecompressHandlers } from "@foxglove/mcap-support"; import { McapStreamReader, hasMcapPrefix, McapConstants } from "@mcap/core"; -import { loadDecompressHandlers } from "@foxglove/mcap-support"; +import Logger from "@lichtblick/log"; import getIndexedMcapInfo from "./getIndexedMcapInfo"; import getStreamedMcapInfo, { processMcapRecord } from "./getStreamedMcapInfo"; diff --git a/packages/suite-desktop/src/quicklook/getStreamedMcapInfo.ts b/packages/suite-desktop/src/quicklook/getStreamedMcapInfo.ts index ee98467e8c..2afaab5f9a 100644 --- a/packages/suite-desktop/src/quicklook/getStreamedMcapInfo.ts +++ b/packages/suite-desktop/src/quicklook/getStreamedMcapInfo.ts @@ -1,10 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { McapTypes } from "@mcap/core"; - import { Time, fromNanoSec, isLessThan, isGreaterThan } from "@foxglove/rostime"; +import { McapTypes } from "@mcap/core"; import { TopicInfo, FileInfo } from "./types"; diff --git a/packages/suite-desktop/src/quicklook/index.tsx b/packages/suite-desktop/src/quicklook/index.tsx index f7119d8bd3..9360a068dd 100644 --- a/packages/suite-desktop/src/quicklook/index.tsx +++ b/packages/suite-desktop/src/quicklook/index.tsx @@ -1,14 +1,18 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ /// -import Logger from "@lichtblick/log"; import { useState, useEffect, useRef } from "react"; import ReactDOM from "react-dom"; import { useAsync } from "react-use"; +import Logger from "@lichtblick/log"; + import FileInfoDisplay from "./FileInfoDisplay"; import Flash from "./Flash"; import { GlobalStyle } from "./GlobalStyle"; diff --git a/packages/suite-desktop/src/quicklook/styleConstants.ts b/packages/suite-desktop/src/quicklook/styleConstants.ts index a2add7ebdc..9f1bdd3826 100644 --- a/packages/suite-desktop/src/quicklook/styleConstants.ts +++ b/packages/suite-desktop/src/quicklook/styleConstants.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/quicklook/types.ts b/packages/suite-desktop/src/quicklook/types.ts index 92c17df8b7..786649a871 100644 --- a/packages/suite-desktop/src/quicklook/types.ts +++ b/packages/suite-desktop/src/quicklook/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/Root.tsx b/packages/suite-desktop/src/renderer/Root.tsx index 531f6a8704..63c77e42c8 100644 --- a/packages/suite-desktop/src/renderer/Root.tsx +++ b/packages/suite-desktop/src/renderer/Root.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useCallback, useEffect, useMemo, useState } from "react"; + import { App, AppSetting, @@ -20,7 +25,6 @@ import { UlogLocalDataSourceFactory, VelodyneDataSourceFactory, } from "@lichtblick/suite-base"; -import { useCallback, useEffect, useMemo, useState } from "react"; import { DesktopExtensionLoader } from "./services/DesktopExtensionLoader"; import { DesktopLayoutLoader } from "./services/DesktopLayoutLoader"; diff --git a/packages/suite-desktop/src/renderer/index.tsx b/packages/suite-desktop/src/renderer/index.tsx index a890cfae4f..e6704fcb57 100644 --- a/packages/suite-desktop/src/renderer/index.tsx +++ b/packages/suite-desktop/src/renderer/index.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ @@ -5,6 +8,10 @@ // Make Electron type definitions available globally, such as extensions to File and other built-ins /// +import { Sockets } from "@foxglove/electron-socket/renderer"; +import { StrictMode, useEffect } from "react"; +import ReactDOM from "react-dom"; + import Logger from "@lichtblick/log"; import { installDevtoolsFormatters, @@ -14,10 +21,6 @@ import { IDataSourceFactory, IAppConfiguration, } from "@lichtblick/suite-base"; -import { StrictMode, useEffect } from "react"; -import ReactDOM from "react-dom"; - -import { Sockets } from "@foxglove/electron-socket/renderer"; import Root from "./Root"; diff --git a/packages/suite-desktop/src/renderer/services/DesktopExtensionLoader.ts b/packages/suite-desktop/src/renderer/services/DesktopExtensionLoader.ts index 1d8bb5b070..4b7c73a96a 100644 --- a/packages/suite-desktop/src/renderer/services/DesktopExtensionLoader.ts +++ b/packages/suite-desktop/src/renderer/services/DesktopExtensionLoader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.test.ts b/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.test.ts index 89f447b046..a81ea857c8 100644 --- a/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.test.ts +++ b/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.ts b/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.ts index 67b9164455..fd7cd973a7 100644 --- a/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.ts +++ b/packages/suite-desktop/src/renderer/services/DesktopLayoutLoader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/services/NativeAppMenu.ts b/packages/suite-desktop/src/renderer/services/NativeAppMenu.ts index a31c70f834..bdb7dfb9aa 100644 --- a/packages/suite-desktop/src/renderer/services/NativeAppMenu.ts +++ b/packages/suite-desktop/src/renderer/services/NativeAppMenu.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.test.ts b/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.test.ts index d8424f172a..3e3eb35759 100644 --- a/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.test.ts +++ b/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.test.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.ts b/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.ts index fa5a600721..d716b45a16 100644 --- a/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.ts +++ b/packages/suite-desktop/src/renderer/services/NativeStorageAppConfiguration.ts @@ -1,9 +1,13 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { IAppConfiguration, AppConfigurationValue, ChangeHandler } from "@lichtblick/suite-base"; import { Mutex } from "async-mutex"; +import { IAppConfiguration, AppConfigurationValue, ChangeHandler } from "@lichtblick/suite-base"; + import { SETTINGS_DATASTORE_NAME, SETTINGS_JSON_DATASTORE_KEY } from "../../common/storage"; import { Storage } from "../../common/types"; diff --git a/packages/suite-desktop/src/renderer/services/NativeWindow.ts b/packages/suite-desktop/src/renderer/services/NativeWindow.ts index 8c5b32d6b2..14682aaa63 100644 --- a/packages/suite-desktop/src/renderer/services/NativeWindow.ts +++ b/packages/suite-desktop/src/renderer/services/NativeWindow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/typings/i18next.d.ts b/packages/suite-desktop/src/typings/i18next.d.ts index 800b733e45..555abdeea9 100644 --- a/packages/suite-desktop/src/typings/i18next.d.ts +++ b/packages/suite-desktop/src/typings/i18next.d.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/webpackDevServerConfig.ts b/packages/suite-desktop/src/webpackDevServerConfig.ts index 1573f4d6e0..f956cfe86d 100644 --- a/packages/suite-desktop/src/webpackDevServerConfig.ts +++ b/packages/suite-desktop/src/webpackDevServerConfig.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-desktop/src/webpackMainConfig.ts b/packages/suite-desktop/src/webpackMainConfig.ts index eb7d7bcf65..dd1e93d06a 100644 --- a/packages/suite-desktop/src/webpackMainConfig.ts +++ b/packages/suite-desktop/src/webpackMainConfig.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; import { ESBuildMinifyPlugin } from "esbuild-loader"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import path from "path"; import { Configuration, DefinePlugin, ResolveOptions } from "webpack"; +import { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; + import { WebpackConfigParams } from "./WebpackConfigParams"; export const webpackMainConfig = diff --git a/packages/suite-desktop/src/webpackPreloadConfig.ts b/packages/suite-desktop/src/webpackPreloadConfig.ts index a920bcd053..77c29cc944 100644 --- a/packages/suite-desktop/src/webpackPreloadConfig.ts +++ b/packages/suite-desktop/src/webpackPreloadConfig.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; import { ESBuildMinifyPlugin } from "esbuild-loader"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; import path from "path"; import { Configuration, DefinePlugin } from "webpack"; +import { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; + import { WebpackConfigParams } from "./WebpackConfigParams"; export const webpackPreloadConfig = diff --git a/packages/suite-desktop/src/webpackQuicklookConfig.ts b/packages/suite-desktop/src/webpackQuicklookConfig.ts index 69f96588d8..70fa4c1b0e 100644 --- a/packages/suite-desktop/src/webpackQuicklookConfig.ts +++ b/packages/suite-desktop/src/webpackQuicklookConfig.ts @@ -1,8 +1,10 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; import ReactRefreshPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import { ESBuildMinifyPlugin } from "esbuild-loader"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; @@ -11,6 +13,8 @@ import path from "path"; import ReactRefreshTypescript from "react-refresh-typescript"; import { Configuration, ProvidePlugin } from "webpack"; +import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; + import { WebpackConfigParams } from "./WebpackConfigParams"; import "webpack-dev-server"; diff --git a/packages/suite-desktop/src/webpackRendererConfig.ts b/packages/suite-desktop/src/webpackRendererConfig.ts index 0d1d13f2d8..f63489bbe3 100644 --- a/packages/suite-desktop/src/webpackRendererConfig.ts +++ b/packages/suite-desktop/src/webpackRendererConfig.ts @@ -1,16 +1,19 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; -import { makeConfig } from "@lichtblick/suite-base/webpack"; +import * as palette from "@foxglove/theme/src/palette"; import ReactRefreshPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import { ESBuildMinifyPlugin } from "esbuild-loader"; import HtmlWebpackPlugin from "html-webpack-plugin"; import path from "path"; import { Configuration, WebpackPluginInstance } from "webpack"; -import * as palette from "@foxglove/theme/src/palette"; +import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; +import { makeConfig } from "@lichtblick/suite-base/webpack"; import { WebpackConfigParams } from "./WebpackConfigParams"; diff --git a/packages/suite-web/src/CompatibilityBanner.stories.tsx b/packages/suite-web/src/CompatibilityBanner.stories.tsx index 7cb21ce084..b287256df6 100644 --- a/packages/suite-web/src/CompatibilityBanner.stories.tsx +++ b/packages/suite-web/src/CompatibilityBanner.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-web/src/CompatibilityBanner.tsx b/packages/suite-web/src/CompatibilityBanner.tsx index 5bd5a3f151..33040418b9 100644 --- a/packages/suite-web/src/CompatibilityBanner.tsx +++ b/packages/suite-web/src/CompatibilityBanner.tsx @@ -1,9 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ import { Dismiss20Filled, Warning24Filled } from "@fluentui/react-icons"; -import Stack from "@lichtblick/suite-base/components/Stack"; +import { createMuiTheme } from "@foxglove/theme"; import { Button, IconButton, @@ -15,7 +18,7 @@ import { import { useState } from "react"; import { makeStyles } from "tss-react/mui"; -import { createMuiTheme } from "@foxglove/theme"; +import Stack from "@lichtblick/suite-base/components/Stack"; const MINIMUM_CHROME_VERSION = 76; const BANNER_HEIGHT = 54; diff --git a/packages/suite-web/src/WebRoot.tsx b/packages/suite-web/src/WebRoot.tsx index 8e35f2038b..90f9863566 100644 --- a/packages/suite-web/src/WebRoot.tsx +++ b/packages/suite-web/src/WebRoot.tsx @@ -1,7 +1,12 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { useMemo, useState } from "react"; + import { AppBarProps, AppSetting, @@ -17,7 +22,6 @@ import { SharedRoot, UlogLocalDataSourceFactory, } from "@lichtblick/suite-base"; -import { useMemo, useState } from "react"; import LocalStorageAppConfiguration from "./services/LocalStorageAppConfiguration"; diff --git a/packages/suite-web/src/canRenderApp.ts b/packages/suite-web/src/canRenderApp.ts index 9f939e0a13..036b5c7f56 100644 --- a/packages/suite-web/src/canRenderApp.ts +++ b/packages/suite-web/src/canRenderApp.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-web/src/index.tsx b/packages/suite-web/src/index.tsx index 89df3e5e96..9482641633 100644 --- a/packages/suite-web/src/index.tsx +++ b/packages/suite-web/src/index.tsx @@ -1,12 +1,16 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import { StrictMode, useEffect } from "react"; +import ReactDOM from "react-dom"; + import Logger from "@lichtblick/log"; import type { IDataSourceFactory } from "@lichtblick/suite-base"; import CssBaseline from "@lichtblick/suite-base/components/CssBaseline"; -import { StrictMode, useEffect } from "react"; -import ReactDOM from "react-dom"; import { CompatibilityBanner } from "./CompatibilityBanner"; import { canRenderApp } from "./canRenderApp"; diff --git a/packages/suite-web/src/services/LocalStorageAppConfiguration.ts b/packages/suite-web/src/services/LocalStorageAppConfiguration.ts index fcfdc617e0..5b37982468 100644 --- a/packages/suite-web/src/services/LocalStorageAppConfiguration.ts +++ b/packages/suite-web/src/services/LocalStorageAppConfiguration.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite-web/src/webpackConfigs.ts b/packages/suite-web/src/webpackConfigs.ts index 8a22224386..60e0dc8c9e 100644 --- a/packages/suite-web/src/webpackConfigs.ts +++ b/packages/suite-web/src/webpackConfigs.ts @@ -1,9 +1,11 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; -import { makeConfig } from "@lichtblick/suite-base/webpack"; +import * as palette from "@foxglove/theme/src/palette"; import ReactRefreshPlugin from "@pmmmwh/react-refresh-webpack-plugin"; import { CleanWebpackPlugin } from "clean-webpack-plugin"; import CopyPlugin from "copy-webpack-plugin"; @@ -15,7 +17,8 @@ import type { Configuration as WebpackDevServerConfiguration, } from "webpack-dev-server"; -import * as palette from "@foxglove/theme/src/palette"; +import type { WebpackArgv } from "@lichtblick/suite-base/WebpackArgv"; +import { makeConfig } from "@lichtblick/suite-base/webpack"; export interface WebpackConfiguration extends Configuration { devServer?: WebpackDevServerConfiguration; diff --git a/packages/suite/src/immutable.ts b/packages/suite/src/immutable.ts index 14bd011a4f..e151555617 100644 --- a/packages/suite/src/immutable.ts +++ b/packages/suite/src/immutable.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/suite/src/index.ts b/packages/suite/src/index.ts index 1226f6ef74..abd87208c4 100644 --- a/packages/suite/src/index.ts +++ b/packages/suite/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiAlert.stories.tsx b/packages/theme/src/components/MuiAlert.stories.tsx index 5c4ea38a5a..5d17fbc581 100644 --- a/packages/theme/src/components/MuiAlert.stories.tsx +++ b/packages/theme/src/components/MuiAlert.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiAlert.tsx b/packages/theme/src/components/MuiAlert.tsx index 94c428fc9d..412a79adf6 100644 --- a/packages/theme/src/components/MuiAlert.tsx +++ b/packages/theme/src/components/MuiAlert.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiAutocomplete.tsx b/packages/theme/src/components/MuiAutocomplete.tsx index b0b7abafae..bc6e190426 100644 --- a/packages/theme/src/components/MuiAutocomplete.tsx +++ b/packages/theme/src/components/MuiAutocomplete.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiAvatar.stories.tsx b/packages/theme/src/components/MuiAvatar.stories.tsx index 8227e80278..0b10af28b7 100644 --- a/packages/theme/src/components/MuiAvatar.stories.tsx +++ b/packages/theme/src/components/MuiAvatar.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiAvatar.ts b/packages/theme/src/components/MuiAvatar.ts index a8dbe36d5c..3d33655564 100644 --- a/packages/theme/src/components/MuiAvatar.ts +++ b/packages/theme/src/components/MuiAvatar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiBackdrop.tsx b/packages/theme/src/components/MuiBackdrop.tsx index d98b00568a..3497cef8a0 100644 --- a/packages/theme/src/components/MuiBackdrop.tsx +++ b/packages/theme/src/components/MuiBackdrop.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiBadge.stories.tsx b/packages/theme/src/components/MuiBadge.stories.tsx index 9c1636632e..cd47ec251c 100644 --- a/packages/theme/src/components/MuiBadge.stories.tsx +++ b/packages/theme/src/components/MuiBadge.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiBadge.ts b/packages/theme/src/components/MuiBadge.ts index b21d4f8325..46b2bd16d8 100644 --- a/packages/theme/src/components/MuiBadge.ts +++ b/packages/theme/src/components/MuiBadge.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiButton.stories.tsx b/packages/theme/src/components/MuiButton.stories.tsx index 2825b61965..04db9478e8 100644 --- a/packages/theme/src/components/MuiButton.stories.tsx +++ b/packages/theme/src/components/MuiButton.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiButton.ts b/packages/theme/src/components/MuiButton.ts index 321d304ccb..7065300b00 100644 --- a/packages/theme/src/components/MuiButton.ts +++ b/packages/theme/src/components/MuiButton.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiButtonBase.ts b/packages/theme/src/components/MuiButtonBase.ts index 47755cb421..6738cf38b0 100644 --- a/packages/theme/src/components/MuiButtonBase.ts +++ b/packages/theme/src/components/MuiButtonBase.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiButtonGroup.stories.tsx b/packages/theme/src/components/MuiButtonGroup.stories.tsx index be90a93ab9..9cf2024a68 100644 --- a/packages/theme/src/components/MuiButtonGroup.stories.tsx +++ b/packages/theme/src/components/MuiButtonGroup.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiButtonGroup.ts b/packages/theme/src/components/MuiButtonGroup.ts index 12dbfe6534..837047581b 100644 --- a/packages/theme/src/components/MuiButtonGroup.ts +++ b/packages/theme/src/components/MuiButtonGroup.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCard.stories.tsx b/packages/theme/src/components/MuiCard.stories.tsx index 0c0e728a42..95d708b919 100644 --- a/packages/theme/src/components/MuiCard.stories.tsx +++ b/packages/theme/src/components/MuiCard.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCard.ts b/packages/theme/src/components/MuiCard.ts index 25bfbdeb5f..8bfb249ad7 100644 --- a/packages/theme/src/components/MuiCard.ts +++ b/packages/theme/src/components/MuiCard.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCardActionArea.ts b/packages/theme/src/components/MuiCardActionArea.ts index f913c8c81d..9b9ff7ebac 100644 --- a/packages/theme/src/components/MuiCardActionArea.ts +++ b/packages/theme/src/components/MuiCardActionArea.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCardContent.ts b/packages/theme/src/components/MuiCardContent.ts index 92c06af5de..da90161d9a 100644 --- a/packages/theme/src/components/MuiCardContent.ts +++ b/packages/theme/src/components/MuiCardContent.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCardHeader.ts b/packages/theme/src/components/MuiCardHeader.ts index 54ff33ae2b..39c4846367 100644 --- a/packages/theme/src/components/MuiCardHeader.ts +++ b/packages/theme/src/components/MuiCardHeader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCheckbox.ts b/packages/theme/src/components/MuiCheckbox.ts index f49fb8da36..6aa24517d8 100644 --- a/packages/theme/src/components/MuiCheckbox.ts +++ b/packages/theme/src/components/MuiCheckbox.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiChip.ts b/packages/theme/src/components/MuiChip.ts index 823012e358..0739861f6a 100644 --- a/packages/theme/src/components/MuiChip.ts +++ b/packages/theme/src/components/MuiChip.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiCssBaseline.ts b/packages/theme/src/components/MuiCssBaseline.ts index 35addf76fe..dd91ae8c28 100644 --- a/packages/theme/src/components/MuiCssBaseline.ts +++ b/packages/theme/src/components/MuiCssBaseline.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiDataGrid.ts b/packages/theme/src/components/MuiDataGrid.ts index c4e5667073..6bd17e7411 100644 --- a/packages/theme/src/components/MuiDataGrid.ts +++ b/packages/theme/src/components/MuiDataGrid.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiDialog.ts b/packages/theme/src/components/MuiDialog.ts index 85130a42c3..12d6748e2c 100644 --- a/packages/theme/src/components/MuiDialog.ts +++ b/packages/theme/src/components/MuiDialog.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiDialogActions.ts b/packages/theme/src/components/MuiDialogActions.ts index 460b133deb..aec8612e2d 100644 --- a/packages/theme/src/components/MuiDialogActions.ts +++ b/packages/theme/src/components/MuiDialogActions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiDialogContent.ts b/packages/theme/src/components/MuiDialogContent.ts index f79ce6a33f..16466ac0d0 100644 --- a/packages/theme/src/components/MuiDialogContent.ts +++ b/packages/theme/src/components/MuiDialogContent.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiDialogTitle.ts b/packages/theme/src/components/MuiDialogTitle.ts index c7dc04c24a..faa59ec409 100644 --- a/packages/theme/src/components/MuiDialogTitle.ts +++ b/packages/theme/src/components/MuiDialogTitle.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiFab.stories.tsx b/packages/theme/src/components/MuiFab.stories.tsx index 430ae393b2..a62f10a92f 100644 --- a/packages/theme/src/components/MuiFab.stories.tsx +++ b/packages/theme/src/components/MuiFab.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiFab.ts b/packages/theme/src/components/MuiFab.ts index 2d7bf57309..2dcf97b56b 100644 --- a/packages/theme/src/components/MuiFab.ts +++ b/packages/theme/src/components/MuiFab.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiFilledInput.ts b/packages/theme/src/components/MuiFilledInput.ts index 4481561da0..0d7a7f1649 100644 --- a/packages/theme/src/components/MuiFilledInput.ts +++ b/packages/theme/src/components/MuiFilledInput.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiFormControl.ts b/packages/theme/src/components/MuiFormControl.ts index 315c3ef041..080c9e2426 100644 --- a/packages/theme/src/components/MuiFormControl.ts +++ b/packages/theme/src/components/MuiFormControl.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiFormLabel.ts b/packages/theme/src/components/MuiFormLabel.ts index ceb05bff16..4dc17767c7 100644 --- a/packages/theme/src/components/MuiFormLabel.ts +++ b/packages/theme/src/components/MuiFormLabel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiIconButton.stories.tsx b/packages/theme/src/components/MuiIconButton.stories.tsx index d0b53b1192..155b3ac979 100644 --- a/packages/theme/src/components/MuiIconButton.stories.tsx +++ b/packages/theme/src/components/MuiIconButton.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiIconButton.ts b/packages/theme/src/components/MuiIconButton.ts index 802649ba5a..d102790ce6 100644 --- a/packages/theme/src/components/MuiIconButton.ts +++ b/packages/theme/src/components/MuiIconButton.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiInput.ts b/packages/theme/src/components/MuiInput.ts index 9563519405..f71d67f292 100644 --- a/packages/theme/src/components/MuiInput.ts +++ b/packages/theme/src/components/MuiInput.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiInputAdornment.ts b/packages/theme/src/components/MuiInputAdornment.ts index bf2614e65d..016a9761c9 100644 --- a/packages/theme/src/components/MuiInputAdornment.ts +++ b/packages/theme/src/components/MuiInputAdornment.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiInputBase.ts b/packages/theme/src/components/MuiInputBase.ts index 5a5dfae977..ee6c925666 100644 --- a/packages/theme/src/components/MuiInputBase.ts +++ b/packages/theme/src/components/MuiInputBase.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiInputLabel.ts b/packages/theme/src/components/MuiInputLabel.ts index 786f36d89c..ff87a34427 100644 --- a/packages/theme/src/components/MuiInputLabel.ts +++ b/packages/theme/src/components/MuiInputLabel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiLinearProgress.ts b/packages/theme/src/components/MuiLinearProgress.ts index 592696e822..6870539a67 100644 --- a/packages/theme/src/components/MuiLinearProgress.ts +++ b/packages/theme/src/components/MuiLinearProgress.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiLink.ts b/packages/theme/src/components/MuiLink.ts index 1d62478508..8a05e4c39a 100644 --- a/packages/theme/src/components/MuiLink.ts +++ b/packages/theme/src/components/MuiLink.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiListItemButton.ts b/packages/theme/src/components/MuiListItemButton.ts index bce4867440..9844dc31c6 100644 --- a/packages/theme/src/components/MuiListItemButton.ts +++ b/packages/theme/src/components/MuiListItemButton.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiListItemText.ts b/packages/theme/src/components/MuiListItemText.ts index 76e3e117e4..2d9af04a2f 100644 --- a/packages/theme/src/components/MuiListItemText.ts +++ b/packages/theme/src/components/MuiListItemText.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiListSubheader.ts b/packages/theme/src/components/MuiListSubheader.ts index d73b44dcc2..cd98a4e542 100644 --- a/packages/theme/src/components/MuiListSubheader.ts +++ b/packages/theme/src/components/MuiListSubheader.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiMenu.ts b/packages/theme/src/components/MuiMenu.ts index 843da37f2d..9f6fbb8add 100644 --- a/packages/theme/src/components/MuiMenu.ts +++ b/packages/theme/src/components/MuiMenu.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiMenuItem.ts b/packages/theme/src/components/MuiMenuItem.ts index 3056316ca5..751d48d790 100644 --- a/packages/theme/src/components/MuiMenuItem.ts +++ b/packages/theme/src/components/MuiMenuItem.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiOutlinedInput.ts b/packages/theme/src/components/MuiOutlinedInput.ts index bc32b3f3c9..dc96a5739b 100644 --- a/packages/theme/src/components/MuiOutlinedInput.ts +++ b/packages/theme/src/components/MuiOutlinedInput.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiPaper.ts b/packages/theme/src/components/MuiPaper.ts index 42dc7752e7..fde501022f 100644 --- a/packages/theme/src/components/MuiPaper.ts +++ b/packages/theme/src/components/MuiPaper.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiPopover.ts b/packages/theme/src/components/MuiPopover.ts index c81760e319..0985708c3c 100644 --- a/packages/theme/src/components/MuiPopover.ts +++ b/packages/theme/src/components/MuiPopover.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiRadio.ts b/packages/theme/src/components/MuiRadio.ts index aeef7bf8b2..a2b656f7b3 100644 --- a/packages/theme/src/components/MuiRadio.ts +++ b/packages/theme/src/components/MuiRadio.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiSelect.ts b/packages/theme/src/components/MuiSelect.ts index 1f52082bb0..087f1cd7e0 100644 --- a/packages/theme/src/components/MuiSelect.ts +++ b/packages/theme/src/components/MuiSelect.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTab.ts b/packages/theme/src/components/MuiTab.ts index 493196361b..cdfc55c037 100644 --- a/packages/theme/src/components/MuiTab.ts +++ b/packages/theme/src/components/MuiTab.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTableCell.ts b/packages/theme/src/components/MuiTableCell.ts index cb0da0eb5d..a7197088f5 100644 --- a/packages/theme/src/components/MuiTableCell.ts +++ b/packages/theme/src/components/MuiTableCell.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTableRow.ts b/packages/theme/src/components/MuiTableRow.ts index 21e1c954b3..964e39dee7 100644 --- a/packages/theme/src/components/MuiTableRow.ts +++ b/packages/theme/src/components/MuiTableRow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTabs.ts b/packages/theme/src/components/MuiTabs.ts index 75baca6c37..60afcfbf28 100644 --- a/packages/theme/src/components/MuiTabs.ts +++ b/packages/theme/src/components/MuiTabs.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTextField.stories.tsx b/packages/theme/src/components/MuiTextField.stories.tsx index 20fdf0812f..2f2c696e5f 100644 --- a/packages/theme/src/components/MuiTextField.stories.tsx +++ b/packages/theme/src/components/MuiTextField.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTextField.ts b/packages/theme/src/components/MuiTextField.ts index fd20c00c0a..82228b4d51 100644 --- a/packages/theme/src/components/MuiTextField.ts +++ b/packages/theme/src/components/MuiTextField.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiToggleButton.ts b/packages/theme/src/components/MuiToggleButton.ts index c20f5a5473..5b3a564cc7 100644 --- a/packages/theme/src/components/MuiToggleButton.ts +++ b/packages/theme/src/components/MuiToggleButton.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiToolbar.ts b/packages/theme/src/components/MuiToolbar.ts index b3e0f4b84c..c2a836b942 100644 --- a/packages/theme/src/components/MuiToolbar.ts +++ b/packages/theme/src/components/MuiToolbar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTooltip.ts b/packages/theme/src/components/MuiTooltip.ts index 42f2eba3ab..b35bc6736c 100644 --- a/packages/theme/src/components/MuiTooltip.ts +++ b/packages/theme/src/components/MuiTooltip.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/MuiTypography.ts b/packages/theme/src/components/MuiTypography.ts index 470e4b719e..0762faaa5e 100644 --- a/packages/theme/src/components/MuiTypography.ts +++ b/packages/theme/src/components/MuiTypography.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/components/index.ts b/packages/theme/src/components/index.ts index a64b7657b7..4cfe0bffc1 100644 --- a/packages/theme/src/components/index.ts +++ b/packages/theme/src/components/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/createMuiTheme.ts b/packages/theme/src/createMuiTheme.ts index 7ac66ee264..f373b73a93 100644 --- a/packages/theme/src/createMuiTheme.ts +++ b/packages/theme/src/createMuiTheme.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/addPanel.ts b/packages/theme/src/i18n/en/addPanel.ts index 20030e10ad..98f89f1e9b 100644 --- a/packages/theme/src/i18n/en/addPanel.ts +++ b/packages/theme/src/i18n/en/addPanel.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/appBar.ts b/packages/theme/src/i18n/en/appBar.ts index 8693cd3def..6882ad750e 100644 --- a/packages/theme/src/i18n/en/appBar.ts +++ b/packages/theme/src/i18n/en/appBar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/appSettings.ts b/packages/theme/src/i18n/en/appSettings.ts index 8842e95f14..16eae5f97f 100644 --- a/packages/theme/src/i18n/en/appSettings.ts +++ b/packages/theme/src/i18n/en/appSettings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/dataSourceInfo.ts b/packages/theme/src/i18n/en/dataSourceInfo.ts index 4201b30516..c2d5c69fc2 100644 --- a/packages/theme/src/i18n/en/dataSourceInfo.ts +++ b/packages/theme/src/i18n/en/dataSourceInfo.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/desktopWindow.ts b/packages/theme/src/i18n/en/desktopWindow.ts index b97f140563..2cf3a80bce 100644 --- a/packages/theme/src/i18n/en/desktopWindow.ts +++ b/packages/theme/src/i18n/en/desktopWindow.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/general.ts b/packages/theme/src/i18n/en/general.ts index 69e99be26c..165feca9ff 100644 --- a/packages/theme/src/i18n/en/general.ts +++ b/packages/theme/src/i18n/en/general.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/incompatibleLayoutVersion.ts b/packages/theme/src/i18n/en/incompatibleLayoutVersion.ts index b1f0dd9605..044a50db91 100644 --- a/packages/theme/src/i18n/en/incompatibleLayoutVersion.ts +++ b/packages/theme/src/i18n/en/incompatibleLayoutVersion.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/index.ts b/packages/theme/src/i18n/en/index.ts index 5c96dbe62e..f217df2745 100644 --- a/packages/theme/src/i18n/en/index.ts +++ b/packages/theme/src/i18n/en/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/log.ts b/packages/theme/src/i18n/en/log.ts index 4cd1fa5a7b..6842756676 100644 --- a/packages/theme/src/i18n/en/log.ts +++ b/packages/theme/src/i18n/en/log.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/openDialog.ts b/packages/theme/src/i18n/en/openDialog.ts index 0b4eb3647a..bc97871c27 100644 --- a/packages/theme/src/i18n/en/openDialog.ts +++ b/packages/theme/src/i18n/en/openDialog.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/panelConfigVersionGuard.ts b/packages/theme/src/i18n/en/panelConfigVersionGuard.ts index 698fee8a86..7cdf854b17 100644 --- a/packages/theme/src/i18n/en/panelConfigVersionGuard.ts +++ b/packages/theme/src/i18n/en/panelConfigVersionGuard.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/panelSettings.ts b/packages/theme/src/i18n/en/panelSettings.ts index aa5bbc5c58..c69b65b8ae 100644 --- a/packages/theme/src/i18n/en/panelSettings.ts +++ b/packages/theme/src/i18n/en/panelSettings.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/panelToolbar.ts b/packages/theme/src/i18n/en/panelToolbar.ts index 5368fdacce..9ea40fa05f 100644 --- a/packages/theme/src/i18n/en/panelToolbar.ts +++ b/packages/theme/src/i18n/en/panelToolbar.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/panels.ts b/packages/theme/src/i18n/en/panels.ts index e34221977e..cd813ac3db 100644 --- a/packages/theme/src/i18n/en/panels.ts +++ b/packages/theme/src/i18n/en/panels.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/plot.ts b/packages/theme/src/i18n/en/plot.ts index 0b65f92a27..115604c9ae 100644 --- a/packages/theme/src/i18n/en/plot.ts +++ b/packages/theme/src/i18n/en/plot.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/problemsList.ts b/packages/theme/src/i18n/en/problemsList.ts index 01feddb142..ccd51b240b 100644 --- a/packages/theme/src/i18n/en/problemsList.ts +++ b/packages/theme/src/i18n/en/problemsList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/settingsEditor.ts b/packages/theme/src/i18n/en/settingsEditor.ts index 67c3c67771..22f1a06fb0 100644 --- a/packages/theme/src/i18n/en/settingsEditor.ts +++ b/packages/theme/src/i18n/en/settingsEditor.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/stateTransitions.ts b/packages/theme/src/i18n/en/stateTransitions.ts index 40283ee5fc..e37d1f1f57 100644 --- a/packages/theme/src/i18n/en/stateTransitions.ts +++ b/packages/theme/src/i18n/en/stateTransitions.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/threeDee.ts b/packages/theme/src/i18n/en/threeDee.ts index 2f0ac1644c..ac8c81cb58 100644 --- a/packages/theme/src/i18n/en/threeDee.ts +++ b/packages/theme/src/i18n/en/threeDee.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/topicList.ts b/packages/theme/src/i18n/en/topicList.ts index 76544a9edd..ede3b90a2e 100644 --- a/packages/theme/src/i18n/en/topicList.ts +++ b/packages/theme/src/i18n/en/topicList.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/en/workspace.ts b/packages/theme/src/i18n/en/workspace.ts index 1abc871e4d..2294cf9fde 100644 --- a/packages/theme/src/i18n/en/workspace.ts +++ b/packages/theme/src/i18n/en/workspace.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/i18n/index.ts b/packages/theme/src/i18n/index.ts index 21881335e0..7c49b26b38 100644 --- a/packages/theme/src/i18n/index.ts +++ b/packages/theme/src/i18n/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts index 083c08350f..ec2bbc4f84 100644 --- a/packages/theme/src/index.ts +++ b/packages/theme/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/palette.stories.tsx b/packages/theme/src/palette.stories.tsx index 3088c07c68..392bd2203f 100644 --- a/packages/theme/src/palette.stories.tsx +++ b/packages/theme/src/palette.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/palette.ts b/packages/theme/src/palette.ts index dc8500ed52..cef66ef6c1 100644 --- a/packages/theme/src/palette.ts +++ b/packages/theme/src/palette.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/types.ts b/packages/theme/src/types.ts index 7ba0e70f05..a407031a69 100644 --- a/packages/theme/src/types.ts +++ b/packages/theme/src/types.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/typography.stories.tsx b/packages/theme/src/typography.stories.tsx index 9a826696d4..23836479fd 100644 --- a/packages/theme/src/typography.stories.tsx +++ b/packages/theme/src/typography.stories.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/theme/src/typography.ts b/packages/theme/src/typography.ts index 11072c29ed..8e89bf95bc 100644 --- a/packages/theme/src/typography.ts +++ b/packages/theme/src/typography.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/typescript-transformers/src/createTssReactNameTransformer.ts b/packages/typescript-transformers/src/createTssReactNameTransformer.ts index 53b3e47dc8..48fe0ea942 100644 --- a/packages/typescript-transformers/src/createTssReactNameTransformer.ts +++ b/packages/typescript-transformers/src/createTssReactNameTransformer.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/packages/typescript-transformers/src/index.ts b/packages/typescript-transformers/src/index.ts index cd1f6f11fc..8f0a0c36a2 100644 --- a/packages/typescript-transformers/src/index.ts +++ b/packages/typescript-transformers/src/index.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/web/integration-test/build.ts b/web/integration-test/build.ts index 12aaa12d40..13d6631be6 100644 --- a/web/integration-test/build.ts +++ b/web/integration-test/build.ts @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/web/integration-test/startup.test.ts b/web/integration-test/startup.test.ts index 8ba70eb17a..b99e982b15 100644 --- a/web/integration-test/startup.test.ts +++ b/web/integration-test/startup.test.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import Logger from "@lichtblick/log"; import http from "http"; import path from "path"; import { chromium } from "playwright"; import serveHandler from "serve-handler"; +import Logger from "@lichtblick/log"; + const log = Logger.getLogger(__filename); describe("startup", () => { diff --git a/web/src/entrypoint.tsx b/web/src/entrypoint.tsx index b45dee67e9..1194fe9a19 100644 --- a/web/src/entrypoint.tsx +++ b/web/src/entrypoint.tsx @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ diff --git a/web/webpack.config.ts b/web/webpack.config.ts index 00ca56d0e3..ce7a2c64eb 100644 --- a/web/webpack.config.ts +++ b/web/webpack.config.ts @@ -1,13 +1,17 @@ +// SPDX-FileCopyrightText: Copyright (C) 2023-2024 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) +// SPDX-License-Identifier: MPL-2.0 + // This Source Code Form is subject to the terms of the Mozilla Public // License, v2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ +import path from "path"; + import { ConfigParams, devServerConfig, mainConfig, } from "@lichtblick/suite-web/src/webpackConfigs"; -import path from "path"; import packageJson from "../package.json"; diff --git a/yarn.lock b/yarn.lock index 3a85a608bf..aed668d130 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2368,35 +2368,6 @@ __metadata: languageName: node linkType: hard -"@foxglove/eslint-plugin-studio@workspace:*, @foxglove/eslint-plugin-studio@workspace:packages/eslint-plugin-studio": - version: 0.0.0-use.local - resolution: "@foxglove/eslint-plugin-studio@workspace:packages/eslint-plugin-studio" - dependencies: - "@foxglove/tsconfig": 2.0.0 - "@typescript-eslint/rule-tester": 6.10.0 - "@typescript-eslint/utils": 6.10.0 - languageName: unknown - linkType: soft - -"@foxglove/eslint-plugin@npm:1.0.0": - version: 1.0.0 - resolution: "@foxglove/eslint-plugin@npm:1.0.0" - dependencies: - "@typescript-eslint/utils": ^6 - tsutils: ^3 - typescript: ^4 || ^5 - peerDependencies: - eslint: ^7 || ^8 - eslint-config-prettier: ^8 - eslint-plugin-es: ^4 - eslint-plugin-filenames: ^1 - eslint-plugin-import: ^2 - eslint-plugin-prettier: ^5 - prettier: ^3 - checksum: 455819c6d2a0de3901fee957688433d631dd7ecd5ad691c838b853cd63a1e2e94362b0b065e83410d979deccabea5959b46d5de994006d80d287c3afc3e4aed0 - languageName: node - linkType: hard - "@foxglove/just-fetch@npm:^1.2.4": version: 1.3.1 resolution: "@foxglove/just-fetch@npm:1.3.1" @@ -3246,6 +3217,35 @@ __metadata: languageName: unknown linkType: soft +"@lichtblick/eslint-plugin-suite@workspace:*, @lichtblick/eslint-plugin-suite@workspace:packages/eslint-plugin-suite": + version: 0.0.0-use.local + resolution: "@lichtblick/eslint-plugin-suite@workspace:packages/eslint-plugin-suite" + dependencies: + "@foxglove/tsconfig": 2.0.0 + "@typescript-eslint/rule-tester": 6.10.0 + "@typescript-eslint/utils": 6.10.0 + languageName: unknown + linkType: soft + +"@lichtblick/eslint-plugin@npm:1.0.1": + version: 1.0.1 + resolution: "@lichtblick/eslint-plugin@npm:1.0.1" + dependencies: + "@typescript-eslint/utils": ^6 + tsutils: ^3 + typescript: ^4 || ^5 + peerDependencies: + eslint: ^7 || ^8 + eslint-config-prettier: ^8 || ^9 + eslint-plugin-es: ^4 + eslint-plugin-filenames: ^1 + eslint-plugin-import: ^2 + eslint-plugin-prettier: ^5 + prettier: ^3 + checksum: 340226c47435888692a4e0f0f8d6a525dffc29ad0b9619d8c38836f8ab19603c032ba5f2205b1d3d21b6718b069a1ab93fa6100a438bde3c7757fee0d0cdbf1e + languageName: node + linkType: hard + "@lichtblick/hooks@workspace:*, @lichtblick/hooks@workspace:packages/hooks": version: 0.0.0-use.local resolution: "@lichtblick/hooks@workspace:packages/hooks" @@ -16212,9 +16212,9 @@ __metadata: "@babel/plugin-proposal-explicit-resource-management": 7.24.7 "@babel/preset-env": 7.25.3 "@babel/preset-typescript": 7.24.7 - "@foxglove/eslint-plugin": 1.0.0 - "@foxglove/eslint-plugin-studio": "workspace:*" "@foxglove/tsconfig": 2.0.0 + "@lichtblick/eslint-plugin": 1.0.1 + "@lichtblick/eslint-plugin-suite": "workspace:*" "@lichtblick/hooks": "workspace:*" "@lichtblick/log": "workspace:*" "@lichtblick/suite": "workspace:*"