diff --git a/.eslintrc.json b/.eslintrc.json index ead01b0e7f..cde53de2df 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,7 +33,7 @@ "react/prop-types": "off", "jsx-quotes": ["error", "prefer-double"], "sort-imports": ["error", { "ignoreDeclarationSort": true }], - "import/order": [ 1, { "groups": ["external", "builtin", "internal", "sibling", "parent", "index"] } ], + "import/order": [ 1, { "groups": ["external", "builtin", ["internal", "sibling", "parent", "index"]], "newlines-between": "always" } ], "quotes": ["error", "double" ] }, "globals": { diff --git a/src/apis/boss.js b/src/apis/boss.js index 052aca388e..d77760cbd9 100644 --- a/src/apis/boss.js +++ b/src/apis/boss.js @@ -16,6 +16,7 @@ */ import cockpit from "cockpit"; + import { _callClient } from "./helpers.js"; const OBJECT_PATH = "/org/fedoraproject/Anaconda/Boss"; diff --git a/src/apis/payloads.js b/src/apis/payloads.js index ed28b65c34..611b7418ef 100644 --- a/src/apis/payloads.js +++ b/src/apis/payloads.js @@ -15,6 +15,7 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; + import { _callClient } from "./helpers.js"; const OBJECT_PATH = "/org/fedoraproject/Anaconda/Modules/Payloads"; diff --git a/src/apis/storage.js b/src/apis/storage.js index eb0dd2c533..ac4697a5f1 100644 --- a/src/apis/storage.js +++ b/src/apis/storage.js @@ -22,7 +22,6 @@ import { getDiskSelectionAction, getPartitioningDataAction } from "../actions/storage-actions.js"; - import { debug } from "../helpers/log.js"; const INTERFACE_NAME = "org.fedoraproject.Anaconda.Modules.Storage"; diff --git a/src/apis/storage_bootloader.js b/src/apis/storage_bootloader.js index 2069d4581a..fd31bd3f20 100644 --- a/src/apis/storage_bootloader.js +++ b/src/apis/storage_bootloader.js @@ -15,6 +15,7 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; + import { StorageClient } from "./storage.js"; import { _setProperty } from "./helpers.js"; diff --git a/src/apis/users.js b/src/apis/users.js index 35aec1ecb4..effbb3db1f 100644 --- a/src/apis/users.js +++ b/src/apis/users.js @@ -15,6 +15,7 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; + import { _callClient, _setProperty } from "./helpers.js"; const OBJECT_PATH = "/org/fedoraproject/Anaconda/Modules/Users"; diff --git a/src/components/AnacondaHeader.jsx b/src/components/AnacondaHeader.jsx index 34e7c7490b..ed274b1902 100644 --- a/src/components/AnacondaHeader.jsx +++ b/src/components/AnacondaHeader.jsx @@ -15,9 +15,7 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; - import React, { useEffect, useState } from "react"; - import { Flex, Label, @@ -28,7 +26,6 @@ import { import { InfoCircleIcon } from "@patternfly/react-icons"; import { HeaderKebab } from "./HeaderKebab.jsx"; - import { getIsFinal } from "../apis/runtime"; import "./AnacondaHeader.scss"; diff --git a/src/components/AnacondaWizard.jsx b/src/components/AnacondaWizard.jsx index c955bc8d11..fdfbd329b7 100644 --- a/src/components/AnacondaWizard.jsx +++ b/src/components/AnacondaWizard.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React, { useContext, useEffect, useMemo, useState } from "react"; - import { ActionList, Button, diff --git a/src/components/Error.jsx b/src/components/Error.jsx index edccd7905b..f2b49cf845 100644 --- a/src/components/Error.jsx +++ b/src/components/Error.jsx @@ -17,7 +17,6 @@ import cockpit from "cockpit"; import React, { useContext, useEffect, useState } from "react"; - import { ActionList, Button, diff --git a/src/components/HeaderKebab.jsx b/src/components/HeaderKebab.jsx index b83dee55d8..49b30b4524 100644 --- a/src/components/HeaderKebab.jsx +++ b/src/components/HeaderKebab.jsx @@ -15,7 +15,6 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; - import React, { useContext, useEffect, useState } from "react"; import { AboutModal, diff --git a/src/components/Password.jsx b/src/components/Password.jsx index eba23c1170..3fa32bd663 100644 --- a/src/components/Password.jsx +++ b/src/components/Password.jsx @@ -18,7 +18,6 @@ import cockpit from "cockpit"; import React, { useEffect, useMemo, useState } from "react"; import { debounce } from "throttle-debounce"; - import { Button, FormGroup, diff --git a/src/components/app.jsx b/src/components/app.jsx index 513f5f1d0d..27d2d43051 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -15,23 +15,19 @@ * along with This program; If not, see . */ import cockpit from "cockpit"; - import React, { useCallback, useEffect, useState } from "react"; - import { Bullseye, Page, PageGroup, } from "@patternfly/react-core"; - import { read_os_release as readOsRelease } from "os-release.js"; - import { WithDialogs } from "dialogs.jsx"; import { EmptyStatePanel } from "cockpit-components-empty-state"; + import { AddressContext, LanguageContext, OsReleaseContext, SystemTypeContext, TargetSystemRootContext } from "./Common.jsx"; import { AnacondaHeader } from "./AnacondaHeader.jsx"; import { AnacondaWizard } from "./AnacondaWizard.jsx"; import { CriticalError, bugzillaPrefiledReportURL, errorHandlerWithContext } from "./Error.jsx"; - import { BossClient } from "../apis/boss.js"; import { LocalizationClient, initDataLocalization, startEventMonitorLocalization } from "../apis/localization.js"; import { StorageClient, initDataStorage, startEventMonitorStorage } from "../apis/storage.js"; @@ -39,9 +35,7 @@ import { PayloadsClient } from "../apis/payloads"; import { RuntimeClient, initDataRuntime, startEventMonitorRuntime } from "../apis/runtime"; import { NetworkClient, initDataNetwork, startEventMonitorNetwork } from "../apis/network.js"; import { UsersClient } from "../apis/users"; - import { setCriticalErrorAction, setCriticalErrorFrontendAction } from "../actions/miscellaneous-actions.js"; - import { readConf } from "../helpers/conf.js"; import { debug } from "../helpers/log.js"; import { initialState, reducer, useReducerWithThunk } from "../reducer.js"; diff --git a/src/components/installation/InstallationProgress.jsx b/src/components/installation/InstallationProgress.jsx index 8fa4c70045..566f0a34d1 100644 --- a/src/components/installation/InstallationProgress.jsx +++ b/src/components/installation/InstallationProgress.jsx @@ -30,11 +30,10 @@ import { InProgressIcon, PendingIcon } from "@patternfly/react-icons"; - import { EmptyStatePanel } from "cockpit-components-empty-state.jsx"; + import { Feedback } from "./Feedback.jsx"; import { OsReleaseContext, SystemTypeContext } from "../Common.jsx"; - import { BossClient, getSteps, installWithTasks } from "../../apis/boss.js"; import { exitGui } from "../../helpers/exit.js"; diff --git a/src/components/localization/InstallationLanguage.jsx b/src/components/localization/InstallationLanguage.jsx index 7a62536d58..88f7cf2bbd 100644 --- a/src/components/localization/InstallationLanguage.jsx +++ b/src/components/localization/InstallationLanguage.jsx @@ -17,7 +17,6 @@ import React, { useEffect, useState } from "react"; import cockpit from "cockpit"; - import { Alert, Divider, @@ -35,11 +34,9 @@ import { import { AddressContext, LanguageContext } from "../Common.jsx"; import { setLocale } from "../../apis/boss.js"; - import { setLanguage, } from "../../apis/localization.js"; - import { convertToCockpitLang, getLangCookie, diff --git a/src/components/review/ReviewConfiguration.jsx b/src/components/review/ReviewConfiguration.jsx index c650c2369b..942fa133cf 100644 --- a/src/components/review/ReviewConfiguration.jsx +++ b/src/components/review/ReviewConfiguration.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React, { useContext, useEffect, useState } from "react"; - import { Button, DescriptionList, DescriptionListDescription, @@ -32,7 +31,6 @@ import { getPartitioningMethod, getPartitioningRequest, } from "../../apis/storage_partitioning.js"; - import { getScenario } from "../storage/InstallationScenario.jsx"; import { OsReleaseContext } from "../Common.jsx"; diff --git a/src/components/review/StorageReview.jsx b/src/components/review/StorageReview.jsx index db832a05c2..16aa76cec6 100644 --- a/src/components/review/StorageReview.jsx +++ b/src/components/review/StorageReview.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React from "react"; - import { List, ListItem, Stack, diff --git a/src/components/storage/CockpitStorageIntegration.jsx b/src/components/storage/CockpitStorageIntegration.jsx index 28826b92a5..3e44afb371 100644 --- a/src/components/storage/CockpitStorageIntegration.jsx +++ b/src/components/storage/CockpitStorageIntegration.jsx @@ -17,7 +17,6 @@ */ import cockpit from "cockpit"; import React, { useEffect, useMemo, useState } from "react"; - import { ActionList, Alert, @@ -39,16 +38,14 @@ import { Title, } from "@patternfly/react-core"; import { ArrowLeftIcon } from "@patternfly/react-icons"; - import { EmptyStatePanel } from "cockpit-components-empty-state"; + import { checkConfiguredStorage, checkUseFreeSpace } from "./InstallationScenario.jsx"; import { useDiskFreeSpace, useDiskTotalSpace, useMountPointConstraints, useRequiredSize } from "./Common.jsx"; - import { runStorageTask, scanDevicesWithTask, } from "../../apis/storage.js"; - import { unlockDevice, } from "../../apis/storage_devicetree.js"; @@ -65,7 +62,6 @@ import { resetPartitioning, setManualPartitioningRequests } from "../../apis/storage_partitioning.js"; - import { getDevicesAction } from "../../actions/storage-actions.js"; import { getDeviceNameByPath } from "../../helpers/storage.js"; diff --git a/src/components/storage/DiskEncryption.jsx b/src/components/storage/DiskEncryption.jsx index 765d1bf2a7..c79a8cb371 100644 --- a/src/components/storage/DiskEncryption.jsx +++ b/src/components/storage/DiskEncryption.jsx @@ -17,7 +17,6 @@ import cockpit from "cockpit"; import React, { useEffect, useState } from "react"; - import { Checkbox, EmptyState, diff --git a/src/components/storage/EncryptedDevices.jsx b/src/components/storage/EncryptedDevices.jsx index 70753b617e..171cfa6d4b 100644 --- a/src/components/storage/EncryptedDevices.jsx +++ b/src/components/storage/EncryptedDevices.jsx @@ -17,7 +17,6 @@ import cockpit from "cockpit"; import React, { useState } from "react"; - import { ActionList, ActionListItem, @@ -34,13 +33,11 @@ import { StackItem, TextInput, } from "@patternfly/react-core"; import { EyeIcon, EyeSlashIcon, LockIcon } from "@patternfly/react-icons"; - import { EmptyStatePanel } from "cockpit-components-empty-state.jsx"; import { InlineNotification } from "cockpit-components-inline-notification.jsx"; import { FormHelper } from "cockpit-components-form-helper.jsx"; import { getDevicesAction } from "../../actions/storage-actions.js"; - import { unlockDevice, } from "../../apis/storage_devicetree.js"; diff --git a/src/components/storage/InstallationDestination.jsx b/src/components/storage/InstallationDestination.jsx index 1c14590212..56fb2109bf 100644 --- a/src/components/storage/InstallationDestination.jsx +++ b/src/components/storage/InstallationDestination.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React, { useContext, useEffect, useRef, useState } from "react"; - import { Alert, AlertActionCloseButton, @@ -44,15 +43,12 @@ import { SyncAltIcon, TimesIcon } from "@patternfly/react-icons"; import { ModifyStorage } from "./ModifyStorage.jsx"; import { SystemTypeContext } from "../Common.jsx"; - import { runStorageTask, scanDevicesWithTask, } from "../../apis/storage.js"; - import { resetPartitioning } from "../../apis/storage_partitioning.js"; import { setSelectedDisks } from "../../apis/storage_disks_selection.js"; - import { getDevicesAction, getDiskSelectionAction } from "../../actions/storage-actions.js"; import { debug } from "../../helpers/log.js"; import { checkIfArraysAreEqual } from "../../helpers/utils.js"; diff --git a/src/components/storage/InstallationMethod.jsx b/src/components/storage/InstallationMethod.jsx index ed9ddf562c..1ea7afdfe4 100644 --- a/src/components/storage/InstallationMethod.jsx +++ b/src/components/storage/InstallationMethod.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React from "react"; - import { Form, HelperText, diff --git a/src/components/storage/InstallationScenario.jsx b/src/components/storage/InstallationScenario.jsx index 1c97e8978c..254c947a91 100644 --- a/src/components/storage/InstallationScenario.jsx +++ b/src/components/storage/InstallationScenario.jsx @@ -17,7 +17,6 @@ import cockpit from "cockpit"; import React, { useContext, useEffect, useState } from "react"; - import { FormGroup, Radio, @@ -30,7 +29,6 @@ import { SystemTypeContext } from "../Common.jsx"; import { setInitializationMode, } from "../../apis/storage_disk_initialization.js"; - import { StorageReview } from "../review/StorageReview.jsx"; import "./InstallationScenario.scss"; diff --git a/src/components/storage/ModifyStorage.jsx b/src/components/storage/ModifyStorage.jsx index 3c48bb59c0..9bd56f9738 100644 --- a/src/components/storage/ModifyStorage.jsx +++ b/src/components/storage/ModifyStorage.jsx @@ -16,7 +16,6 @@ */ import cockpit from "cockpit"; import React, { useContext } from "react"; - import { Button, } from "@patternfly/react-core"; diff --git a/src/components/storage/MountPointMapping.jsx b/src/components/storage/MountPointMapping.jsx index 2aa74ac48d..2d4af12804 100644 --- a/src/components/storage/MountPointMapping.jsx +++ b/src/components/storage/MountPointMapping.jsx @@ -17,7 +17,6 @@ import cockpit from "cockpit"; import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; - import { Button, Flex, @@ -34,13 +33,11 @@ import { SelectVariant } from "@patternfly/react-core/deprecated"; import { TrashIcon } from "@patternfly/react-icons"; - import { ListingTable } from "cockpit-components-table.jsx"; import { EmptyStatePanel } from "cockpit-components-empty-state.jsx"; import { EncryptedDevices } from "./EncryptedDevices.jsx"; import { useMountPointConstraints } from "./Common.jsx"; - import { setBootloaderDrive, } from "../../apis/storage_bootloader.js"; diff --git a/src/components/users/Accounts.jsx b/src/components/users/Accounts.jsx index e62efecaf1..62f4a16ed7 100644 --- a/src/components/users/Accounts.jsx +++ b/src/components/users/Accounts.jsx @@ -30,6 +30,7 @@ import { InputGroup, TextInput, } from "@patternfly/react-core"; + import encryptUserPw from "../../scripts/encrypt-user-pw.py"; import { clearRootPassword, diff --git a/src/index.js b/src/index.js index e182cb7e28..3757653f78 100644 --- a/src/index.js +++ b/src/index.js @@ -22,6 +22,7 @@ import "../pkg/lib/patternfly/patternfly-5-cockpit.scss"; import React from "react"; import { createRoot } from "react-dom/client"; import cockpit from "cockpit"; + import { Application } from "./components/app.jsx"; /* * PF4 overrides need to come after the JSX components imports because