Skip to content

Commit

Permalink
[web] Add index file for components/network module
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Nov 21, 2022
1 parent b7dd76f commit abb83b4
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 25 deletions.
2 changes: 1 addition & 1 deletion web/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { Layout, Title, AdditionalInfo, LoadingEnvironment, DBusError } from "@c
import About from "@components/core/About";
import InstallationProgress from "@components/core/InstallationProgress";
import InstallationFinished from "@components/core/InstallationFinished.jsx";
import TargetIpsPopup from "@components/network/TargetIpsPopup";
import { TargetIpsPopup } from "@components/network";

function App() {
const client = useInstallerClient();
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/core/Overview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Category from "@components/core/Category";
import LanguageSelector from "@components/language/LanguageSelector";
import Storage from "@components/storage/Storage";
import Users from "@components/users/Users";
import Network from "@components/network/Network";
import Network from "@components/network";
import InstallButton from "@components/core/InstallButton";

import {
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/network/ConnectionsDataList.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
import React from "react";
import { screen } from "@testing-library/react";
import { plainRender } from "@/test-utils";
import ConnectionsDataList from "@components/network/ConnectionsDataList";

import { ConnectionTypes } from "@client/network";
import ConnectionsDataList from "@components/network/ConnectionsDataList";

jest.mock("@client");

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/DnsDataList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
} from "@patternfly/react-core";

import FormLabel from "@components/core/FormLabel";
import IpAddressInput from "@components/network/IpAddressInput";
import { IpAddressInput } from "@components/network";

let index = 0;

Expand Down
4 changes: 2 additions & 2 deletions web/src/components/network/IpSettingsForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import React, { useState } from "react";
import { HelperText, HelperTextItem, Form, FormGroup, FormSelect, FormSelectOption, TextInput } from "@patternfly/react-core";

import { useInstallerClient } from "@context/installer";
import AddressesDataList from "./AddressesDataList";
import DnsDataList from "@components/network/DnsDataList";
import Popup from "@components/core/Popup";
import { AddressesDataList, DnsDataList } from "@components/network";

const METHODS = {
MANUAL: "manual",
Expand Down
5 changes: 2 additions & 3 deletions web/src/components/network/Network.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

import React, { useEffect, useState } from "react";
import { Button, Stack, StackItem } from "@patternfly/react-core";

import { useInstallerClient } from "@context/installer";
import { ConnectionTypes, NetworkEventTypes } from "@client/network";
import NetworkWiredStatus from "./NetworkWiredStatus";
import NetworkWifiStatus from "@components/network/NetworkWifiStatus";
import WifiSelector from "./WifiSelector";
import { NetworkWifiStatus, NetworkWiredStatus, WifiSelector } from "@components/network";

export default function Network() {
const client = useInstallerClient();
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/network/NetworkWifiStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
*/

import React, { useState } from "react";
import IpSettingsForm from "@components/network/IpSettingsForm";
import ConnectionsDataList from "@components/network/ConnectionsDataList";

import { useInstallerClient } from "@context/installer";
import { ConnectionsDataList, IpSettingsForm } from "@components/network";

/**
* D-Installer component to show status of wireless network connections
Expand Down
3 changes: 1 addition & 2 deletions web/src/components/network/NetworkWiredStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
*/

import React, { useState } from "react";
import IpSettingsForm from "@components/network/IpSettingsForm";
import ConnectionsDataList from "@components/network/ConnectionsDataList";
import { useInstallerClient } from "@context/installer";

import { ConnectionState } from "@client/network";
import { IpSettingsForm, ConnectionsDataList } from "@components/network";

/**
* D-Installer component to show status of wired network connections
Expand Down
5 changes: 3 additions & 2 deletions web/src/components/network/TargetIpsPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@

import React, { useEffect, useState } from "react";
import { Button, List, ListItem, Text } from "@patternfly/react-core";
import Popup from "@components/core/Popup";

import { useInstallerClient } from "@context/installer";
import { useCancellablePromise } from "@/utils";
import { useInstallerClient } from "@context/installer";
import { formatIp } from "@client/network/utils";

import Popup from "@components/core/Popup";

export default function TargetIpsPopup() {
const client = useInstallerClient();
const { cancellablePromise } = useCancellablePromise();
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/TargetIpsPopup.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { act, screen, waitFor, within } from "@testing-library/react";
import { installerRender } from "@/test-utils";
import { createClient } from "@client";

import TargetIpsPopup from "@components/network/TargetIpsPopup";
import { TargetIpsPopup } from "@components/network";

jest.mock("@client");

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/WifiHiddenNetworkForm.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React from "react";
import { screen } from "@testing-library/react";
import { plainRender } from "@/test-utils";

import WifiHiddenNetworkForm from "./WifiHiddenNetworkForm";
import { WifiHiddenNetworkForm } from "@components/network";

jest.mock("@components/network/WifiConnectionForm", () => () => "WifiConnectionForm mock");

Expand Down
3 changes: 1 addition & 2 deletions web/src/components/network/WifiNetworkListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ import { classNames } from "@/utils";
import { ConnectionState } from "@client/network/model";

import { Center } from "@components/layout";
import WifiNetworkMenu from "./WifiNetworkMenu";
import WifiConnectionForm from "./WifiConnectionForm";
import { WifiNetworkMenu, WifiConnectionForm } from "@components/network";

const networkState = (state) => {
switch (state) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/WifiNetworkListItem.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React from "react";
import { screen } from "@testing-library/react";
import { installerRender } from "@/test-utils";

import WifiNetworkListItem from "./WifiNetworkListItem";
import { WifiNetworkListItem } from "@components/network";

jest.mock("@components/network/WifiConnectionForm", () => () => "WifiConnectionForm mock");
jest.mock("@components/network/WifiNetworkMenu", () => () => "WifiNetworkMenu mock");
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/WifiNetworksList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import React from "react";

import WifiNetworkListItem from "./WifiNetworkListItem";
import { WifiNetworkListItem } from "@components/network";

/**
* Component for displaying a list of available Wi-Fi networks
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/network/WifiNetworksList.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import React from "react";
import { screen, waitFor } from "@testing-library/react";
import { installerRender } from "@/test-utils";

import WifiNetworksList from "./WifiNetworksList";
import { WifiNetworksList } from "@components/network";

const onSelectionCallback = jest.fn();

Expand Down
4 changes: 1 addition & 3 deletions web/src/components/network/WifiSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ import React, { useEffect, useState } from "react";

import { useInstallerClient } from "@context/installer";
import { NetworkEventTypes } from "@client/network";

import Popup from "@components/core/Popup";
import WifiNetworksList from "./WifiNetworksList";
import WifiHiddenNetworkForm from "./WifiHiddenNetworkForm";
import { WifiNetworksList, WifiHiddenNetworkForm } from "@components/network";

const networksFromValues = (networks) => Object.values(networks).flat();
const baseHiddenNetwork = { ssid: undefined, hidden: true };
Expand Down
37 changes: 37 additions & 0 deletions web/src/components/network/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) [2022] SUSE LLC
*
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, contact SUSE LLC.
*
* To contact SUSE LLC about this file by physical or electronic mail, you may
* find current contact information at www.suse.com.
*/

export { default } from "./Network";
export { default as Network } from "./Network";
export { default as AddressesDataList } from "./AddressesDataList";
export { default as ConnectionsDataList } from "./ConnectionsDataList";
export { default as DnsDataList } from "./DnsDataList";
export { default as IpAddressInput } from "./IpAddressInput";
export { default as IpPrefixInput } from "./IpPrefixInput";
export { default as NetworkWifiStatus } from "./NetworkWifiStatus";
export { default as NetworkWiredStatus } from "./NetworkWiredStatus";
export { default as TargetIpsPopup } from "./TargetIpsPopup";
export { default as WifiConnectionForm } from "./WifiConnectionForm";
export { default as WifiHiddenNetworkForm } from "./WifiHiddenNetworkForm";
export { default as WifiNetworkListItem } from "./WifiNetworkListItem";
export { default as WifiNetworkMenu } from "./WifiNetworkMenu";
export { default as WifiNetworksList } from "./WifiNetworksList";
export { default as WifiSelector } from "./WifiSelector";

0 comments on commit abb83b4

Please sign in to comment.