Skip to content

Commit

Permalink
undo goland's wonderful formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Oct 22, 2023
1 parent 074f592 commit c9edb1c
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 307 deletions.
49 changes: 31 additions & 18 deletions web/src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React, {useEffect, useReducer} from "react";
import {createBrowserHistory} from "history";
import {Navigate, Route, Routes, useNavigate} from "react-router-dom";
import {Helmet} from "react-helmet";
import React, { useEffect, useReducer } from "react";
import { createBrowserHistory } from "history";
import { Navigate, Route, Routes, useNavigate } from "react-router-dom";
import { Helmet } from "react-helmet";
import Modal from "react-modal";
import find from "lodash/find";
import ConnectionTerminated from "./ConnectionTerminated";
import GitOps from "./components/clusters/GitOps";
import PreflightResultPage from "./components/PreflightResultPage";
import AppConfig from "./features/AppConfig/components/AppConfig";
import {AppDetailPage} from "./components/apps/AppDetailPage";
import { AppDetailPage } from "./components/apps/AppDetailPage";
import KurlClusterManagement from "./components/apps/KurlClusterManagement";
import EmbeddedClusterManagement from "@components/apps/EmbeddedClusterManagement";
import UnsupportedBrowser from "./components/static/UnsupportedBrowser";
import NotFound from "./components/static/NotFound";
import {parseUpstreamUri, Utilities} from "./utilities/utilities";
import { parseUpstreamUri, Utilities } from "./utilities/utilities";
import fetch from "./utilities/fetchWithTimeout";
import {SecureAdminConsole} from "@features/Auth";
import { SecureAdminConsole } from "@features/Auth";
import UploadLicenseFile from "./components/UploadLicenseFile";
import BackupRestore from "./components/BackupRestore";
import UploadAirgapBundle from "./components/UploadAirgapBundle";
import RestoreCompleted from "./components/RestoreCompleted";
import Access from "./components/identity/Access";
import SnapshotsWrapper from "./components/snapshots/SnapshotsWrapper";
import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
import {InstallWithHelm} from "@features/AddNewApp";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { InstallWithHelm } from "@features/AddNewApp";
import DownstreamTree from "./components/tree/KotsApplicationTree";
import {Dashboard} from "@features/Dashboard/components/Dashboard";
import { Dashboard } from "@features/Dashboard/components/Dashboard";
import AppVersionHistory from "@components/apps/AppVersionHistory";
import AppLicense from "@components/apps/AppLicense";
import AppRegistrySettings from "@components/apps/AppRegistrySettings";
Expand All @@ -42,8 +42,8 @@ import "./index.css";
import connectHistory from "./services/matomo";

// types
import {App, Metadata, ThemeState} from "@types";
import {ToastProvider} from "./context/ToastContext";
import { App, Metadata, ThemeState } from "@types";
import { ToastProvider } from "./context/ToastContext";
import Redactors from "@components/redactors/Redactors";
import EditRedactor from "@components/redactors/EditRedactor";
import SupportBundleAnalysis from "@components/troubleshoot/SupportBundleAnalysis";
Expand Down Expand Up @@ -467,7 +467,9 @@ const Root = () => {
refetchAppsList={getAppsList}
fetchingMetadata={state.fetchingMetadata}
isKurlEnabled={Boolean(state.adminConsoleMetadata?.isKurl)}
isEmbeddedClusterEnabled={Boolean(state.adminConsoleMetadata?.isEmbeddedCluster)}
isEmbeddedClusterEnabled={Boolean(
state.adminConsoleMetadata?.isEmbeddedCluster
)}
isGitOpsSupported={isGitOpsSupported()}
isIdentityServiceSupported={isIdentityServiceSupported()}
appsList={state.appsList}
Expand Down Expand Up @@ -532,7 +534,9 @@ const Root = () => {
appSlugFromMetadata={state.appSlugFromMetadata || ""}
fetchingMetadata={state.fetchingMetadata}
onUploadSuccess={getAppsList}
isEmbeddedCluster={Boolean(state.adminConsoleMetadata?.isEmbeddedCluster)}
isEmbeddedCluster={Boolean(
state.adminConsoleMetadata?.isEmbeddedCluster
)}
/>
}
/>
Expand Down Expand Up @@ -579,7 +583,9 @@ const Root = () => {
<>
<Route
path="/:slug/cluster/manage"
element={<EmbeddedClusterManagement fromLicenseFlow={true} />}
element={
<EmbeddedClusterManagement fromLicenseFlow={true} />
}
/>
<Route
path="/:slug/cluster/:nodeName"
Expand All @@ -601,7 +607,10 @@ const Root = () => {
/>
)}
{state.adminConsoleMetadata?.isEmbeddedCluster && (
<Route path="/cluster/:nodeName" element={<EmbeddedClusterViewNode />} />
<Route
path="/cluster/:nodeName"
element={<EmbeddedClusterViewNode />}
/>
)}
<Route
path="/gitops"
Expand Down Expand Up @@ -692,7 +701,9 @@ const Root = () => {
snapshotInProgressApps={state.snapshotInProgressApps}
ping={ping}
isHelmManaged={state.isHelmManaged}
isEmbeddedCluster={Boolean(state.adminConsoleMetadata?.isEmbeddedCluster)}
isEmbeddedCluster={Boolean(
state.adminConsoleMetadata?.isEmbeddedCluster
)}
/>
}
/>
Expand All @@ -708,7 +719,9 @@ const Root = () => {
snapshotInProgressApps={state.snapshotInProgressApps}
ping={ping}
isHelmManaged={state.isHelmManaged}
isEmbeddedCluster={Boolean(state.adminConsoleMetadata?.isEmbeddedCluster)}
isEmbeddedCluster={Boolean(
state.adminConsoleMetadata?.isEmbeddedCluster
)}
/>
}
>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/UploadLicenseFile.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useReducer} from "react";
import {Link, useNavigate} from "react-router-dom";
import React, { useEffect, useReducer } from "react";
import { Link, useNavigate } from "react-router-dom";
import yaml from "js-yaml";
import isEmpty from "lodash/isEmpty";
import keyBy from "lodash/keyBy";
Expand All @@ -10,8 +10,8 @@ import Dropzone from "react-dropzone";
import Modal from "react-modal";
import Select from "react-select";

import {KotsPageTitle} from "@components/Head";
import {getFileContent} from "../utilities/utilities";
import { KotsPageTitle } from "@components/Head";
import { getFileContent } from "../utilities/utilities";
import Icon from "./Icon";
import LicenseUploadProgress from "./LicenseUploadProgress";
import CodeSnippet from "./shared/CodeSnippet";
Expand Down
17 changes: 10 additions & 7 deletions web/src/components/apps/AppDetailPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, {Fragment, useEffect, useReducer, useState} from "react";
import React, { Fragment, useEffect, useReducer, useState } from "react";
import classNames from "classnames";
import {Outlet, useNavigate, useParams} from "react-router-dom";
import { Outlet, useNavigate, useParams } from "react-router-dom";
import Modal from "react-modal";
import {useTheme} from "@src/components/context/withTheme";
import {HelmChartSidebarItem, KotsSidebarItem} from "@src/components/watches/WatchSidebarItem";
import {isAwaitingResults} from "../../utilities/utilities";
import { useTheme } from "@src/components/context/withTheme";
import {
HelmChartSidebarItem,
KotsSidebarItem,
} from "@src/components/watches/WatchSidebarItem";
import { isAwaitingResults } from "../../utilities/utilities";

import SubNavBar from "@src/components/shared/SubNavBar";
import SidebarLayout from "../layout/SidebarLayout/SidebarLayout";
Expand All @@ -14,8 +17,8 @@ import Loader from "../shared/Loader";
import ErrorModal from "../modals/ErrorModal";

// Types
import {App, KotsParams, Metadata, Version} from "@types";
import {useApps, useSelectedApp} from "@features/App";
import { App, KotsParams, Metadata, Version } from "@types";
import { useApps, useSelectedApp } from "@features/App";

type Props = {
adminConsoleMetadata?: Metadata;
Expand Down
22 changes: 11 additions & 11 deletions web/src/components/apps/AppVersionHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from "react";
import {Link} from "react-router-dom";
import React, { Component } from "react";
import { Link } from "react-router-dom";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
import Modal from "react-modal";
Expand All @@ -14,7 +14,7 @@ import ShowDetailsModal from "@src/components/modals/ShowDetailsModal";
import ShowLogsModal from "@src/components/modals/ShowLogsModal";
import AirgapUploadProgress from "@src/features/Dashboard/components/AirgapUploadProgress";
import ErrorModal from "../modals/ErrorModal";
import {AppVersionHistoryRow} from "@features/AppVersionHistory/AppVersionHistoryRow";
import { AppVersionHistoryRow } from "@features/AppVersionHistory/AppVersionHistoryRow";
import DeployWarningModal from "../shared/modals/DeployWarningModal";
import AutomaticUpdatesModal from "@src/components/modals/AutomaticUpdatesModal";
import SkipPreflightsModal from "../shared/modals/SkipPreflightsModal";
Expand All @@ -26,19 +26,19 @@ import {
secondsAgo,
Utilities,
} from "../../utilities/utilities";
import {Repeater} from "../../utilities/repeater";
import {AirgapUploader} from "../../utilities/airgapUploader";
import { Repeater } from "../../utilities/repeater";
import { AirgapUploader } from "../../utilities/airgapUploader";
import ReactTooltip from "react-tooltip";
import Pager from "../shared/Pager";
import {HelmDeployModal} from "../shared/modals/HelmDeployModal";
import {UseDownloadValues} from "../hooks";
import {KotsPageTitle} from "@components/Head";
import { HelmDeployModal } from "../shared/modals/HelmDeployModal";
import { UseDownloadValues } from "../hooks";
import { KotsPageTitle } from "@components/Head";

import "@src/scss/components/apps/AppVersionHistory.scss";
import {DashboardGitOpsCard} from "@features/Dashboard";
import { DashboardGitOpsCard } from "@features/Dashboard";
import Icon from "../Icon";
import {App, Version, VersionDownloadStatus} from "@types";
import {RouterProps, withRouter} from "@src/utilities/react-router-utilities";
import { App, Version, VersionDownloadStatus } from "@types";
import { RouterProps, withRouter } from "@src/utilities/react-router-utilities";
import PreflightIcon from "@features/App/PreflightIcon";

dayjs.extend(relativeTime);
Expand Down
33 changes: 18 additions & 15 deletions web/src/components/apps/EmbeddedClusterManagement.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {useQuery} from "@tanstack/react-query";
import { useQuery } from "@tanstack/react-query";
import classNames from "classnames";
import MaterialReactTable, {MRT_ColumnDef} from "material-react-table";
import React, {ChangeEvent, useMemo, useReducer, useState} from "react";
import MaterialReactTable, { MRT_ColumnDef } from "material-react-table";
import React, { ChangeEvent, useMemo, useReducer, useState } from "react";
import Modal from "react-modal";
import {Link, useParams} from "react-router-dom";
import { Link, useParams } from "react-router-dom";

import {KotsPageTitle} from "@components/Head";
import {useApps} from "@features/App";
import {rbacRoles} from "../../constants/rbac";
import {Utilities} from "../../utilities/utilities";
import { KotsPageTitle } from "@components/Head";
import { useApps } from "@features/App";
import { rbacRoles } from "../../constants/rbac";
import { Utilities } from "../../utilities/utilities";
import Icon from "../Icon";
import CodeSnippet from "../shared/CodeSnippet";

Expand Down Expand Up @@ -124,13 +124,16 @@ const EmbeddedClusterManagement = ({
} = useQuery<NodesResponse, Error, NodesResponse>({
queryKey: ["embeddedClusterNodes"],
queryFn: async () => {
const res = await fetch(`${process.env.API_ENDPOINT}/embedded-cluster/nodes`, {
headers: {
Accept: "application/json",
},
credentials: "include",
method: "GET",
});
const res = await fetch(
`${process.env.API_ENDPOINT}/embedded-cluster/nodes`,
{
headers: {
Accept: "application/json",
},
credentials: "include",
method: "GET",
}
);
if (!res.ok) {
if (res.status === 401) {
Utilities.logoutUser();
Expand Down
25 changes: 14 additions & 11 deletions web/src/components/apps/EmbeddedClusterViewNode.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {MaterialReactTable} from "material-react-table";
import React, {useMemo} from "react";
import {useQuery} from "@tanstack/react-query";
import {Link, useParams} from "react-router-dom";
import { MaterialReactTable } from "material-react-table";
import React, { useMemo } from "react";
import { useQuery } from "@tanstack/react-query";
import { Link, useParams } from "react-router-dom";
import Loader from "@components/shared/Loader";

const testData = undefined;
Expand Down Expand Up @@ -43,13 +43,16 @@ const EmbeddedClusterViewNode = () => {
queryFn: async ({ queryKey }) => {
const [, nodeName] = queryKey;
return (
await fetch(`${process.env.API_ENDPOINT}/embedded-cluster/node/${nodeName}`, {
headers: {
Accept: "application/json",
},
credentials: "include",
method: "GET",
})
await fetch(
`${process.env.API_ENDPOINT}/embedded-cluster/node/${nodeName}`,
{
headers: {
Accept: "application/json",
},
credentials: "include",
method: "GET",
}
)
).json();
},
onError: (err) => {
Expand Down
10 changes: 5 additions & 5 deletions web/src/components/shared/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, {PureComponent} from "react";
import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import classNames from "classnames";
import {RouterProps, withRouter} from "@src/utilities/react-router-utilities";
import {Link} from "react-router-dom";
import {Utilities} from "@src/utilities/utilities";
import { RouterProps, withRouter } from "@src/utilities/react-router-utilities";
import { Link } from "react-router-dom";
import { Utilities } from "@src/utilities/utilities";
import ErrorModal from "../modals/ErrorModal";
import NavBarDropdown from "./NavBarDropdown";

import "@src/scss/components/shared/NavBar.scss";
import {App} from "@types";
import { App } from "@types";

type Props = {
appsList: App[];
Expand Down
Loading

0 comments on commit c9edb1c

Please sign in to comment.