Ver Fonte

Fix `npm run format` command

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu há 1 ano atrás
pai
commit
0c650eb0a0
52 ficheiros alterados com 255 adições e 205 exclusões
  1. 8 9
      .storybook/main.js
  2. 9 10
      .storybook/preview.js
  3. 1 1
      .vscode/launch.json
  4. 1 1
      README.md
  5. 13 15
      public/index.html
  6. 17 17
      public/manifest.json
  7. 5 7
      server/api/ConfigApi.ts
  8. 1 1
      server/api/LogosApi.ts
  9. 1 1
      server/main.ts
  10. 3 3
      server/proxies/azureProxy.ts
  11. 2 2
      server/start.js
  12. 4 4
      src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.spec.tsx
  13. 1 2
      src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx
  14. 4 2
      src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx
  15. 1 4
      src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx
  16. 1 1
      src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx
  17. 3 1
      src/components/modules/DashboardModule/DashboardLicence/DashboardLicence.spec.tsx
  18. 2 2
      src/components/modules/DashboardModule/DashboardLicence/DashboardLicence.tsx
  19. 1 5
      src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx
  20. 12 4
      src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx
  21. 7 6
      src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx
  22. 5 1
      src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx
  23. 8 8
      src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx
  24. 5 1
      src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx
  25. 3 3
      src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx
  26. 3 1
      src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.spec.tsx
  27. 6 2
      src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx
  28. 1 4
      src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx
  29. 1 1
      src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx
  30. 4 1
      src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx
  31. 1 1
      src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx
  32. 19 15
      src/components/modules/WizardModule/WizardType/WizardType.tsx
  33. 22 17
      src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx
  34. 6 2
      src/components/smart/DeploymentsPage/DeploymentsPage.tsx
  35. 4 1
      src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx
  36. 4 4
      src/components/smart/EndpointsPage/EndpointsPage.tsx
  37. 5 4
      src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx
  38. 6 2
      src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx
  39. 3 1
      src/components/smart/TransfersPage/TransfersPage.tsx
  40. 1 3
      src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx
  41. 12 6
      src/components/ui/Lists/MainMultiFilterList/MainMultiFilterList.spec.tsx
  42. 2 1
      src/constants.ts
  43. 2 3
      src/plugins/default/OptionsSchemaPlugin.ts
  44. 1 1
      src/plugins/rhev/OptionsSchemaPlugin.ts
  45. 6 3
      src/sources/DeploymentSource.ts
  46. 1 3
      src/sources/NotificationSource.ts
  47. 2 5
      src/sources/WizardSource.ts
  48. 8 2
      src/stores/ScheduleStore.ts
  49. 8 2
      src/stores/TransferStore.ts
  50. 3 2
      src/utils/LabelDictionary.ts
  51. 5 2
      tests/fileTransform.js
  52. 1 5
      ui-mod-sample.json

+ 8 - 9
.storybook/main.js

@@ -1,8 +1,7 @@
-const baseConfig = require('../webpack.common')
-
+const baseConfig = require("../webpack.common");
 
 module.exports = {
-  stories: ['../src/**/story.tsx'],
+  stories: ["../src/**/story.tsx"],
   webpackFinal: config => {
     return {
       ...config,
@@ -13,14 +12,14 @@ module.exports = {
           {
             test: /\.js$/,
             exclude: /node_modules/,
-            loader: require.resolve('babel-loader'),
+            loader: require.resolve("babel-loader"),
           },
-        ]
+        ],
       },
       resolve: {
         ...config.resolve,
-        ...baseConfig.resolve
+        ...baseConfig.resolve,
       },
-    }
-  }
-}
+    };
+  },
+};

+ 9 - 10
.storybook/preview.js

@@ -1,16 +1,16 @@
-import React from 'react'
-import { addDecorator } from '@storybook/react'
-import styled, { createGlobalStyle } from 'styled-components'
+import React from "react";
+import { addDecorator } from "@storybook/react";
+import styled, { createGlobalStyle } from "styled-components";
 
-import { ThemePalette, ThemeProps } from '@src/components/Theme'
-import Fonts from '@src/components/ui/Fonts'
-import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
+import { ThemePalette, ThemeProps } from "@src/components/Theme";
+import Fonts from "@src/components/ui/Fonts";
+import { BrowserRouter as Router, Switch, Route } from "react-router-dom";
 
 const Wrapper = styled.div`
   display: inline-block;
   background: ${ThemePalette.grayscale[7]};
   padding: 32px;
-`
+`;
 
 const GlobalStyle = createGlobalStyle`
   ${Fonts}
@@ -22,7 +22,7 @@ const GlobalStyle = createGlobalStyle`
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
   }
-`
+`;
 
 addDecorator(storyFn => (
   <Router>
@@ -33,5 +33,4 @@ addDecorator(storyFn => (
       </Wrapper>
     </Switch>
   </Router>
-  )
-)
+));

+ 1 - 1
.vscode/launch.json

@@ -12,6 +12,6 @@
       "port": 9222,
       "urlFilter": "http://localhost:3001/*",
       "webRoot": "${workspaceFolder}"
-    },
+    }
   ]
 }

+ 1 - 1
README.md

@@ -1,6 +1,6 @@
 # ![Coriolis Web](/src/components/ui/Logo/images/coriolis-small-black.svg)
 
-Web  GUI for [coriolis](https://github.com/cloudbase/coriolis)
+Web GUI for [coriolis](https://github.com/cloudbase/coriolis)
 
 [![Build and Test](https://github.com/cloudbase/coriolis-web/actions/workflows/build.yml/badge.svg)](https://github.com/cloudbase/coriolis-web/actions/workflows/build.yml) [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
 

+ 13 - 15
public/index.html

@@ -1,19 +1,17 @@
 <!DOCTYPE html>
 <html>
+  <head>
+    <title>Coriolis</title>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
+    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
+    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
+    <link rel="manifest" href="/manifest.json" />
+    <meta name="theme-color" content="#ffffff" />
+  </head>
 
-<head>
-  <title>Coriolis</title>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
-  <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
-  <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
-  <link rel="manifest" href="/manifest.json">
-  <meta name="theme-color" content="#ffffff">
-</head>
-
-<body>
-  <main id="app"></main>
-</body>
-
+  <body>
+    <main id="app"></main>
+  </body>
 </html>

+ 17 - 17
public/manifest.json

@@ -1,18 +1,18 @@
 {
-    "name": "",
-    "icons": [
-        {
-            "src": "/android-chrome-192x192.png",
-            "sizes": "192x192",
-            "type": "image/png"
-        },
-        {
-            "src": "/android-chrome-256x256.png",
-            "sizes": "256x256",
-            "type": "image/png"
-        }
-    ],
-    "theme_color": "#ffffff",
-    "background_color": "#ffffff",
-    "display": "standalone"
-}
+  "name": "",
+  "icons": [
+    {
+      "src": "/android-chrome-192x192.png",
+      "sizes": "192x192",
+      "type": "image/png"
+    },
+    {
+      "src": "/android-chrome-256x256.png",
+      "sizes": "256x256",
+      "type": "image/png"
+    }
+  ],
+  "theme_color": "#ffffff",
+  "background_color": "#ffffff",
+  "display": "standalone"
+}

+ 5 - 7
server/api/ConfigApi.ts

@@ -30,7 +30,7 @@ const modServicesUrls = (
 ): Services => {
   const services = { ...configServices };
 
-  Object.keys(services).forEach((key) => {
+  Object.keys(services).forEach(key => {
     const typedKey = key as keyof Services;
     services[typedKey] = (
       servicesMod && servicesMod[typedKey]
@@ -58,7 +58,7 @@ export default (router: express.Router) => {
       try {
         const jsonContent: any = fs.readFileSync(modJsonPath);
         const configMod = JSON.parse(jsonContent).config;
-        Object.keys(configMod).forEach((key) => {
+        Object.keys(configMod).forEach(key => {
           if (key !== "servicesUrls") {
             config[key] = configMod[key];
           }
@@ -76,11 +76,9 @@ export default (router: express.Router) => {
     .post("/config/first-launch", (req, res) => {
       const { isFirstLaunch } = req.body;
       if (isFirstLaunch !== false) {
-        res
-          .status(422)
-          .json({
-            error: { message: "'isFirstLaunch' property not set to 'false'" },
-          });
+        res.status(422).json({
+          error: { message: "'isFirstLaunch' property not set to 'false'" },
+        });
         return;
       }
       fs.writeFileSync(NOT_FIRST_LAUNCH_PATH, "");

+ 1 - 1
server/api/LogosApi.ts

@@ -32,7 +32,7 @@ const getOptimalLogoHeightKey = (
 ): string => {
   let heightKeys = availableHeightKeys;
   if (style) {
-    const styledKeys = heightKeys.filter((k) =>
+    const styledKeys = heightKeys.filter(k =>
       style ? k.indexOf(style) > -1 : false
     );
     if (styledKeys.length) {

+ 1 - 1
server/main.ts

@@ -22,7 +22,7 @@ export default () => {
   const app = express();
 
   const PORT = Number(process.env.PORT) || 3000;
-  const BIND = process.env.BIND || '127.0.0.1'
+  const BIND = process.env.BIND || "127.0.0.1";
 
   app.use(express.static("dist"));
 

+ 3 - 3
server/proxies/azureProxy.ts

@@ -65,17 +65,17 @@ export default (router: express.Router) => {
       "base64"
     ).toString();
     const headers: any = {};
-    forwardHeaders.forEach((headerName) => {
+    forwardHeaders.forEach(headerName => {
       if (req.headers[headerName] != null) {
         headers[headerName] = req.headers[headerName];
       }
     });
 
     axios({ url, headers })
-      .then((response) => {
+      .then(response => {
         res.send(response.data);
       })
-      .catch((error) => {
+      .catch(error => {
         if (error.response) {
           res
             .status(error.response.status)

+ 2 - 2
server/start.js

@@ -1,5 +1,5 @@
 // This file is required because we cannot directly import a .ts file from index.js
 
-import main from './main'
+import main from "./main";
 
-main()
+main();

+ 4 - 4
src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.spec.tsx

@@ -85,10 +85,10 @@ describe("DashboardActivity", () => {
   });
 
   it.each`
-    idx  | href                     | expectedStatusIcon
-    ${0} | ${"/replicas/1"}         | ${"error-hollow.svg"}
-    ${1} | ${"/migrations/2/tasks"} | ${encodedProgressImage}
-    ${2} | ${"/migrations/3"}       | ${"success-hollow.svg"}
+    idx  | href                | expectedStatusIcon
+    ${0} | ${"/deployments/1"} | ${"error-hollow.svg"}
+    ${1} | ${"/deployments/2"} | ${encodedProgressImage}
+    ${2} | ${"/deployments/3"} | ${"success-hollow.svg"}
   `("renders item with href $href", ({ idx, href, expectedStatusIcon }) => {
     render(<DashboardActivity notificationItems={ITEMS} />);
 

+ 1 - 2
src/components/modules/DashboardModule/DashboardActivity/DashboardActivity.tsx

@@ -105,8 +105,7 @@ class DashboardActivity extends React.Component<Props> {
           .filter((_, i) => i < (this.props.large ? 10 : 5))
           .map((item, i) => {
             const actionHref =
-              item.type === "transfer"
-                ? "transfers" : "deployments"
+              item.type === "transfer" ? "transfers" : "deployments";
 
             const executionsHref =
               item.status === "RUNNING"

+ 4 - 2
src/components/modules/DashboardModule/DashboardContent/DashboardContent.tsx

@@ -176,12 +176,14 @@ class DashboardContent extends React.Component<Props, State> {
 
   getReplicas() {
     return this.props.transfers.filter(
-      (r: TransferItem) => r.scenario === "replica");
+      (r: TransferItem) => r.scenario === "replica"
+    );
   }
 
   getLiveMigrations() {
     return this.props.transfers.filter(
-      (r: TransferItem) => r.scenario === "live_migration");
+      (r: TransferItem) => r.scenario === "live_migration"
+    );
   }
 
   render() {

+ 1 - 4
src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.spec.tsx

@@ -22,10 +22,7 @@ import TestUtils from "@tests/TestUtils";
 
 import DashboardExecutions from "./DashboardExecutions";
 
-const transferItem = (
-  scenario: string,
-  date: string
-): TransferItem => {
+const transferItem = (scenario: string, date: string): TransferItem => {
   return {
     id: "",
     type: "transfer",

+ 1 - 1
src/components/modules/DashboardModule/DashboardExecutions/DashboardExecutions.tsx

@@ -136,7 +136,7 @@ type Props = {
 type GroupedData = {
   label: string;
   values: number[];
-  data?: string
+  data?: string;
 };
 type TooltipData = {
   title: string;

+ 3 - 1
src/components/modules/DashboardModule/DashboardLicence/DashboardLicence.spec.tsx

@@ -109,7 +109,9 @@ describe("DashboardLicence", () => {
     expect(TestUtils.select("DashboardLicence__LicenceError-")).toBeTruthy();
     expect(
       TestUtils.select("DashboardLicence__LicenceError-")?.textContent
-    ).toContain("Please contact Cloudbase Solutions with your Appliance ID");
+    ).toContain(
+      "Please contact your Coriolis representative with the Appliance ID"
+    );
     expect(
       TestUtils.select("DashboardLicence__ApplianceId-")?.textContent
     ).toBe("Appliance ID:test-id-licencev2");

+ 2 - 2
src/components/modules/DashboardModule/DashboardLicence/DashboardLicence.tsx

@@ -277,8 +277,8 @@ class DashboardLicence extends React.Component<Props> {
     return (
       <LicenceError>
         <p>
-          Please contact your Coriolis representative with the Appliance ID in order to
-          obtain a Coriolis® licence.
+          Please contact your Coriolis representative with the Appliance ID in
+          order to obtain a Coriolis® licence.
         </p>
         <ApplianceIdWrapper>
           <ApplianceId>

+ 1 - 5
src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.spec.tsx

@@ -102,11 +102,7 @@ describe("DashboardTopEndpoints", () => {
 
   it("should display no data message", () => {
     render(
-      <DashboardTopEndpoints
-        {...defaultProps}
-        transfers={[]}
-        endpoints={[]}
-      />
+      <DashboardTopEndpoints {...defaultProps} transfers={[]} endpoints={[]} />
     );
     expect(TestUtils.select("DashboardTopEndpoints__NoItems")).toBeTruthy();
   });

+ 12 - 4
src/components/modules/DashboardModule/DashboardTopEndpoints/DashboardTopEndpoints.tsx

@@ -176,17 +176,25 @@ class DashboardTopEndpoints extends React.Component<Props, State> {
 
   calculateGroupedEndpoints(props: Props) {
     const groupedEndpoints: GroupedEndpoint[] = [];
-    const count = (mainItems: TransferItem[], endpointId: string, scenario: string) =>
+    const count = (
+      mainItems: TransferItem[],
+      endpointId: string,
+      scenario: string
+    ) =>
       mainItems.filter(
         r =>
-          r.scenario === scenario && (
-            r.destination_endpoint_id === endpointId ||
+          r.scenario === scenario &&
+          (r.destination_endpoint_id === endpointId ||
             r.origin_endpoint_id === endpointId)
       ).length;
 
     props.endpoints.forEach(endpoint => {
       const replicasCount = count(props.transfers, endpoint.id, "replica");
-      const migrationsCount = count(props.transfers, endpoint.id, "live_migration");
+      const migrationsCount = count(
+        props.transfers,
+        endpoint.id,
+        "live_migration"
+      );
       groupedEndpoints.push({
         endpoint,
         replicasCount: replicasCount,

+ 7 - 6
src/components/modules/EndpointModule/EndpointDetailsContent/EndpointDetailsContent.tsx

@@ -18,10 +18,7 @@ import { Link } from "react-router-dom";
 import styled from "styled-components";
 
 import { Field as FieldType } from "@src/@types/Field";
-import {
-  getTransferItemTitle,
-  TransferItem,
-} from "@src/@types/MainItem";
+import { getTransferItemTitle, TransferItem } from "@src/@types/MainItem";
 import { Region } from "@src/@types/Region";
 import EndpointLogos from "@src/components/modules/EndpointModule/EndpointLogos";
 import { ThemePalette, ThemeProps } from "@src/components/Theme";
@@ -100,7 +97,7 @@ type Props = {
   regions: Region[];
   connectionInfo: Endpoint["connection_info"] | null;
   loading: boolean;
-  transfers: TransferItem[],
+  transfers: TransferItem[];
   connectionInfoSchema: FieldType[];
   onDeleteClick: () => void;
   onValidateClick: () => void;
@@ -289,7 +286,11 @@ class EndpointDetailsContent extends React.Component<Props> {
           </Field>
           <Field>
             <Label>Used in transfers ({this.props.transfers.length})</Label>
-            {this.props.transfers.length > 0 ? this.renderUsage(this.props.transfers) : <Value>-</Value>}
+            {this.props.transfers.length > 0 ? (
+              this.renderUsage(this.props.transfers)
+            ) : (
+              <Value>-</Value>
+            )}
           </Field>
           {!this.props.connectionInfo
             ? this.renderConnectionInfoLoading()

+ 5 - 1
src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMachines.tsx

@@ -333,7 +333,11 @@ class MinionPoolMachines extends React.Component<Props, State> {
                           {allocatedAction.type === "transfer" ? "TR" : "DE"}
                         </ItemTransferBadge>
                         <ValueLink
-                          to={`/${allocatedAction.type === "transfer" ? "transfers" : "deployments"}/${allocatedAction.id}`}
+                          to={`/${
+                            allocatedAction.type === "transfer"
+                              ? "transfers"
+                              : "deployments"
+                          }/${allocatedAction.id}`}
                         >
                           {allocatedAction.instances[0]}
                         </ValueLink>

+ 8 - 8
src/components/modules/MinionModule/MinionPoolDetailsContent/MinionPoolMainDetails.tsx

@@ -237,15 +237,15 @@ class MinionPoolMainDetails extends React.Component<Props> {
 
   renderUsage(items: ActionItem[]) {
     return items.map(item => {
-      const actionHref =
-        item.type === "transfer"
-          ? "transfers" : "deployments"
+      const actionHref = item.type === "transfer" ? "transfers" : "deployments";
 
-      return (<div key={item.id}>
-        <ValueLink to={`/${actionHref}/${item.id}`}>
-          {item.instances[0]}
-        </ValueLink>
-      </div>);
+      return (
+        <div key={item.id}>
+          <ValueLink to={`/${actionHref}/${item.id}`}>
+            {item.instances[0]}
+          </ValueLink>
+        </div>
+      );
     });
   }
 

+ 5 - 1
src/components/modules/TransferModule/DeleteTransferModal/DeleteReplicaModal.spec.tsx

@@ -45,7 +45,11 @@ describe("DeleteReplicaModal", () => {
 
   it("is multiple replica selection with disks", () => {
     render(
-      <DeleteTransferModal {...defaultProps} hasDisks isMultiTransferSelection />
+      <DeleteTransferModal
+        {...defaultProps}
+        hasDisks
+        isMultiTransferSelection
+      />
     );
     expect(
       TestUtils.select("DeleteReplicaModal__ExtraMessage")?.textContent

+ 3 - 3
src/components/modules/TransferModule/DeleteTransferModal/DeleteTransferModal.tsx

@@ -88,9 +88,9 @@ class DeleteTransferModal extends React.Component<Props> {
             Some of the selected Transfer have been executed at least once and
             thus may have disks created on the destination platform. If those
             Transfers are to be deleted now, the disks on the destination will
-            persist. If this is not desired, please use the &quot;Delete Transfer
-            Disks&quot; option to delete those disks before deleting the
-            Transfers themselves.
+            persist. If this is not desired, please use the &quot;Delete
+            Transfer Disks&quot; option to delete those disks before deleting
+            the Transfers themselves.
           </ExtraMessage>
         );
       }

+ 3 - 1
src/components/modules/TransferModule/DeploymentDetailsContent/DeploymentDetailsContent.spec.tsx

@@ -57,7 +57,9 @@ describe("DeploymentDetailsContent", () => {
   });
 
   it("renders without crashing", () => {
-    const { getByText } = render(<DeploymentDetailsContent {...defaultProps} />);
+    const { getByText } = render(
+      <DeploymentDetailsContent {...defaultProps} />
+    );
     expect(getByText(DEPLOYMENT_ITEM_DETAILS_MOCK.id)).toBeTruthy();
   });
 

+ 6 - 2
src/components/modules/TransferModule/DeploymentOptions/ReplicaDeploymentOptions.spec.tsx

@@ -81,7 +81,9 @@ describe("ReplicaDeploymentOptions", () => {
   });
 
   it("renders without crashing", () => {
-    const { getByText } = render(<ReplicaDeploymentOptions {...defaultProps} />);
+    const { getByText } = render(
+      <ReplicaDeploymentOptions {...defaultProps} />
+    );
     expect(getByText("Deploy")).toBeTruthy();
   });
 
@@ -147,7 +149,9 @@ describe("ReplicaDeploymentOptions", () => {
   });
 
   it("handles migrate click", () => {
-    const { getByText } = render(<ReplicaDeploymentOptions {...defaultProps} />);
+    const { getByText } = render(
+      <ReplicaDeploymentOptions {...defaultProps} />
+    );
     fireEvent.click(getByText("Deploy"));
     expect(defaultProps.onDeployClick).toHaveBeenCalled();
   });

+ 1 - 4
src/components/modules/TransferModule/TransferItemModal/TransferItemModal.tsx

@@ -36,10 +36,7 @@ import WizardOptions, {
 } from "@src/components/modules/WizardModule/WizardOptions";
 import WizardStorage from "@src/components/modules/WizardModule/WizardStorage";
 
-import type {
-  UpdateData,
-  ActionItemDetails,
-} from "@src/@types/MainItem";
+import type { UpdateData, ActionItemDetails } from "@src/@types/MainItem";
 import {
   Endpoint,
   EndpointUtils,

+ 1 - 1
src/components/modules/TransferModule/TransferListItem/TransferListItem.tsx

@@ -125,7 +125,7 @@ class TransferListItem extends React.Component<Props> {
 
   getTransferScenarioType() {
     let scenario = "";
-    switch(this.props.item.type) {
+    switch (this.props.item.type) {
       case "transfer":
         scenario = this.props.item.scenario;
         break;

+ 4 - 1
src/components/modules/WizardModule/WizardOptions/WizardOptions.tsx

@@ -328,7 +328,10 @@ class WizardOptions extends React.Component<Props> {
       fieldsSchema.push(titleFieldSchema);
     }
 
-    if (this.props.wizardType === "replica" || this.props.wizardType === "migration") {
+    if (
+      this.props.wizardType === "replica" ||
+      this.props.wizardType === "migration"
+    ) {
       fieldsSchema.push({
         name: "execute_now",
         type: "boolean",

+ 1 - 1
src/components/modules/WizardModule/WizardSummary/WizardSummary.tsx

@@ -467,7 +467,7 @@ class WizardSummary extends React.Component<Props> {
         <SectionTitle>{type} Target Options</SectionTitle>
         <OptionsList>
           {this.props.wizardType === "replica" ? executeNowOption : null}
-          {this.props.wizardType === "migration" ? executeNowOption: null}
+          {this.props.wizardType === "migration" ? executeNowOption : null}
           {this.props.data.selectedInstances &&
           this.props.data.selectedInstances.length > 1
             ? separateVmOption

+ 19 - 15
src/components/modules/WizardModule/WizardType/WizardType.tsx

@@ -76,13 +76,15 @@ class WizardType extends React.Component<Props> {
           <Column alignRight width="50%">
             <Title>Coriolis Migration</Title>
             <Message selected={this.props.selected === "migration"}>
-              Coriolis Migrations allow for the incremental copying of
-              a virtual machine&apos;s data from the source environment to
-              disks in the target environment with zero downtime.
-              <br /><br />
-              Migrations can be synced (executed) any number of times,
-              but can be deployed in the target environment only once.
-              <br /><br />
+              Coriolis Migrations allow for the incremental copying of a virtual
+              machine&apos;s data from the source environment to disks in the
+              target environment with zero downtime.
+              <br />
+              <br />
+              Migrations can be synced (executed) any number of times, but can
+              be deployed in the target environment only once.
+              <br />
+              <br />
               Migrations are licenced one-time per each transferred VM.
             </Message>
           </Column>
@@ -96,14 +98,16 @@ class WizardType extends React.Component<Props> {
           <Column width="50%">
             <Title>Coriolis Replica</Title>
             <Message selected={this.props.selected === "replica"}>
-              Coriolis Replicas allow for the incremental copying of
-              a virtual machine&apos;s data from the source environment to
-              disks in the target environment with zero downtime.
-              <br /><br />
-              Replicas can be synced (executed) any number of times,
-              and can be deployed in the target environment any time a
-              disaster recovery procedure is desired.
-              <br /><br />
+              Coriolis Replicas allow for the incremental copying of a virtual
+              machine&apos;s data from the source environment to disks in the
+              target environment with zero downtime.
+              <br />
+              <br />
+              Replicas can be synced (executed) any number of times, and can be
+              deployed in the target environment any time a disaster recovery
+              procedure is desired.
+              <br />
+              <br />
               Replicas are licenced monthly per each replicated VM.
             </Message>
           </Column>

+ 22 - 17
src/components/smart/DeploymentDetailsPage/DeploymentDetailsPage.tsx

@@ -16,7 +16,10 @@ import { observer } from "mobx-react";
 import React from "react";
 import styled from "styled-components";
 
-import { getTransferItemTitle, DeploymentItemDetails } from "@src/@types/MainItem";
+import {
+  getTransferItemTitle,
+  DeploymentItemDetails,
+} from "@src/@types/MainItem";
 import DetailsContentHeader from "@src/components/modules/DetailsModule/DetailsContentHeader";
 import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
 import DetailsTemplate from "@src/components/modules/TemplateModule/DetailsTemplate";
@@ -38,7 +41,7 @@ import userStore from "@src/stores/UserStore";
 import configLoader from "@src/utils/Config";
 
 import replicaDeploymentImage from "./images/replica-deployment.svg";
-import liveMigrationDeploymentImage from "./images/live-migration-deployment.svg"
+import liveMigrationDeploymentImage from "./images/live-migration-deployment.svg";
 
 import type { Field } from "@src/@types/Field";
 import type { InstanceScript } from "@src/@types/Instance";
@@ -120,7 +123,9 @@ class DeploymentDetailsPage extends React.Component<Props, State> {
     return should_red;
   }
 
-  getDeploymentScenarioTypeImage(details: DeploymentItemDetails | null): string {
+  getDeploymentScenarioTypeImage(
+    details: DeploymentItemDetails | null
+  ): string {
     let image = replicaDeploymentImage;
     const scenario = details?.transfer_scenario_type;
     if (scenario && scenario === "live_migration") {
@@ -506,25 +511,25 @@ class DeploymentDetailsPage extends React.Component<Props, State> {
               statusPill={
                 deploymentStore.deploymentDetails?.last_execution_status
               }
-              itemTitle={getTransferItemTitle(deploymentStore.deploymentDetails)}
-              itemType={
-                this.getDeploymentScenarioItemType(
-                  deploymentStore.deploymentDetails)
-              }
+              itemTitle={getTransferItemTitle(
+                deploymentStore.deploymentDetails
+              )}
+              itemType={this.getDeploymentScenarioItemType(
+                deploymentStore.deploymentDetails
+              )}
               itemDescription={deploymentStore.deploymentDetails?.description}
               backLink="/deployments"
-              typeImage={
-                this.getDeploymentScenarioTypeImage(
-                  deploymentStore.deploymentDetails)
-              }
+              typeImage={this.getDeploymentScenarioTypeImage(
+                deploymentStore.deploymentDetails
+              )}
               dropdownActions={dropdownActions}
-              alertInfoPill={
-                this.getTransferTypePillShouldRed(
-                  deploymentStore.deploymentDetails)
-              }
+              alertInfoPill={this.getTransferTypePillShouldRed(
+                deploymentStore.deploymentDetails
+              )}
               primaryInfoPill={
                 !this.getTransferTypePillShouldRed(
-                  deploymentStore.deploymentDetails)
+                  deploymentStore.deploymentDetails
+                )
               }
             />
           }

+ 6 - 2
src/components/smart/DeploymentsPage/DeploymentsPage.tsx

@@ -92,12 +92,16 @@ class DeploymentsPage extends React.Component<{ history: any }, State> {
   }
 
   getStatus(deploymentId: string): string {
-    const deployment = deploymentStore.deployments.find(m => m.id === deploymentId);
+    const deployment = deploymentStore.deployments.find(
+      m => m.id === deploymentId
+    );
     return deployment ? deployment.last_execution_status : "";
   }
 
   getDeploymentType(deploymentId: string): string {
-    const deployment = deploymentStore.deployments.find(m => m.id === deploymentId);
+    const deployment = deploymentStore.deployments.find(
+      m => m.id === deploymentId
+    );
     return deployment ? deployment.transfer_scenario_type : "";
   }
 

+ 4 - 1
src/components/smart/EndpointDetailsPage/EndpointDetailsPage.tsx

@@ -87,7 +87,10 @@ class EndpointDetailsPage extends React.Component<Props, State> {
     );
   }
 
-  getEndpointUsage(): { deployments: DeploymentItem[]; transfers: TransferItem[] } {
+  getEndpointUsage(): {
+    deployments: DeploymentItem[];
+    transfers: TransferItem[];
+  } {
     const endpointId = this.props.match.params.id;
     const transfers = transferStore.transfers.filter(
       r =>

+ 4 - 4
src/components/smart/EndpointsPage/EndpointsPage.tsx

@@ -109,14 +109,14 @@ class EndpointsPage extends React.Component<{ history: any }, State> {
     const replicasCount = transferStore.transfers.filter(
       r =>
         (r.origin_endpoint_id === endpointId ||
-         r.destination_endpoint_id === endpointId) &&
-         r.scenario === "replica"
+          r.destination_endpoint_id === endpointId) &&
+        r.scenario === "replica"
     ).length;
     const migrationsCount = transferStore.transfers.filter(
       r =>
         (r.origin_endpoint_id === endpointId ||
-         r.destination_endpoint_id === endpointId) &&
-         r.scenario === "live_migration"
+          r.destination_endpoint_id === endpointId) &&
+        r.scenario === "live_migration"
     ).length;
 
     return { migrationsCount, replicasCount };

+ 5 - 4
src/components/smart/MinionPoolDetailsPage/MinionPoolDetailsPage.tsx

@@ -354,7 +354,7 @@ class MinionPoolDetailsPage extends React.Component<Props, State> {
       },
     ];
 
-    const checkPoolUsed = (i: ActionItem): boolean|undefined => {
+    const checkPoolUsed = (i: ActionItem): boolean | undefined => {
       return (
         i.origin_minion_pool_id === this.minionPool?.id ||
         i.destination_minion_pool_id === this.minionPool?.id ||
@@ -362,9 +362,10 @@ class MinionPoolDetailsPage extends React.Component<Props, State> {
           this.minionPool?.id &&
           Object.values(i.instance_osmorphing_minion_pool_mappings).includes(
             this.minionPool.id
-          ))
-      ) || undefined;
-    }
+          )) ||
+        undefined
+      );
+    };
 
     return (
       <Wrapper>

+ 6 - 2
src/components/smart/TransferDetailsPage/TransferDetailsPage.tsx

@@ -16,7 +16,10 @@ import { observer } from "mobx-react";
 import React from "react";
 import styled from "styled-components";
 
-import { getTransferItemTitle, TransferItemDetails } from "@src/@types/MainItem";
+import {
+  getTransferItemTitle,
+  TransferItemDetails,
+} from "@src/@types/MainItem";
 import DetailsContentHeader from "@src/components/modules/DetailsModule/DetailsContentHeader";
 import DetailsPageHeader from "@src/components/modules/DetailsModule/DetailsPageHeader";
 import DetailsTemplate from "@src/components/modules/TemplateModule/DetailsTemplate";
@@ -839,7 +842,8 @@ class TransferDetailsPage extends React.Component<Props, State> {
               p =>
                 p ===
                 endpointStore.endpoints.find(
-                  e => e.id === transferStore.transferDetails?.origin_endpoint_id
+                  e =>
+                    e.id === transferStore.transferDetails?.origin_endpoint_id
                 )?.type
             )}
             onCancelClick={() => {

+ 3 - 1
src/components/smart/TransfersPage/TransfersPage.tsx

@@ -355,7 +355,9 @@ class TransfersPage extends React.Component<{ history: any }, State> {
     let atLeastOneHasExecuteEnabled = false;
     let atLeaseOneIsRunning = false;
     this.state.selectedTransfers.forEach(transfer => {
-      const storeTransfer = transferStore.transfers.find(r => r.id === transfer.id);
+      const storeTransfer = transferStore.transfers.find(
+        r => r.id === transfer.id
+      );
       atLeastOneHasExecuteEnabled =
         atLeastOneHasExecuteEnabled || this.isExecuteEnabled(storeTransfer);
       const status = this.getStatus(storeTransfer);

+ 1 - 3
src/components/ui/Dropdowns/NotificationDropdown/NotificationDropdown.tsx

@@ -275,9 +275,7 @@ class NotificationDropdown extends React.Component<Props, State> {
       <List>
         {this.props.items.map(item => {
           const typeUrl =
-            item.type === "deployment"
-              ? "deployments"
-              : "transfers";
+            item.type === "deployment" ? "deployments" : "transfers";
 
           const executionsPath =
             item.status === "RUNNING"

+ 12 - 6
src/components/ui/Lists/MainMultiFilterList/MainMultiFilterList.spec.tsx

@@ -77,9 +77,9 @@ describe("MainMultiFilterList", () => {
     expect(
       TestUtils.select("SearchInput__Wrapper")?.querySelector("input")?.value
     ).toBe("test");
-    expect(TestUtils.select("MainMultiFilterList__SelectionText")?.textContent).toBe(
-      "1 of 3\u00a0test item(s) selected"
-    );
+    expect(
+      TestUtils.select("MainMultiFilterList__SelectionText")?.textContent
+    ).toBe("1 of 3\u00a0test item(s) selected");
   });
 
   it("renders actions", () => {
@@ -98,14 +98,18 @@ describe("MainMultiFilterList", () => {
 
   it("fires filter item click", () => {
     const onFilterItemClick = jest.fn();
-    render(<MainMultiFilterListWrapper onFilterItemClick={onFilterItemClick} />);
+    render(
+      <MainMultiFilterListWrapper onFilterItemClick={onFilterItemClick} />
+    );
     TestUtils.selectAll("MainMultiFilterList__FilterItem-")[1].click();
     expect(onFilterItemClick).toHaveBeenCalledWith(FILTER_ITEMS[1]);
   });
 
   it("has select all change", () => {
     const onSelectAllChange = jest.fn();
-    render(<MainMultiFilterListWrapper onSelectAllChange={onSelectAllChange} />);
+    render(
+      <MainMultiFilterListWrapper onSelectAllChange={onSelectAllChange} />
+    );
 
     const checkbox = TestUtils.select("Checkbox__Wrapper")!;
     const style = () => window.getComputedStyle(checkbox);
@@ -123,7 +127,9 @@ describe("MainMultiFilterList", () => {
 
   it("fires reload button click", () => {
     const onReloadButtonClick = jest.fn();
-    render(<MainMultiFilterListWrapper onReloadButtonClick={onReloadButtonClick} />);
+    render(
+      <MainMultiFilterListWrapper onReloadButtonClick={onReloadButtonClick} />
+    );
     TestUtils.select("ReloadButton__Wrapper")!.click();
     expect(onReloadButtonClick).toHaveBeenCalled();
   });

+ 2 - 1
src/constants.ts

@@ -66,7 +66,8 @@ export const executionOptions = [
     label: "Shutdown Instance(s)",
     defaultValue: false,
     nullableBoolean: false,
-    description: "When enabling this option, Coriolis will attempt to gracefully shut down the source instance(s), before syncing their data. This is recommended when executing Migrations, right before planning on completely Deploying on the destination cloud, as it will transfer the last chunks of data after the instance(s) have been shut down, and it leaves the source instance(s) off."
+    description:
+      "When enabling this option, Coriolis will attempt to gracefully shut down the source instance(s), before syncing their data. This is recommended when executing Migrations, right before planning on completely Deploying on the destination cloud, as it will transfer the last chunks of data after the instance(s) have been shut down, and it leaves the source instance(s) off.",
   },
 ];
 

+ 2 - 3
src/plugins/default/OptionsSchemaPlugin.ts

@@ -174,9 +174,8 @@ export const defaultGetMigrationImageMap = (
   oldOptions: any,
   migrationImageMapFieldName: string
 ) => {
-
-  console.log("defaultGetMigrationImageMap called with old env: ")
-  console.log(oldOptions)
+  console.log("defaultGetMigrationImageMap called with old env: ");
+  console.log(oldOptions);
   const env: any = {};
   const usableOptions = options;
   if (!usableOptions) {

+ 1 - 1
src/plugins/rhev/OptionsSchemaPlugin.ts

@@ -93,7 +93,7 @@ export default class OptionsSchemaParser extends OptionsSchemaPluginBase {
       this.migrationImageMapFieldName
     );
     console.log("RHEV Migration image map computation: ");
-    console.log(migration_image_map_opt)
+    console.log(migration_image_map_opt);
     const env = {
       ...defaultGetDestinationEnv(options, oldOptions),
       ...migration_image_map_opt,

+ 6 - 3
src/sources/DeploymentSource.ts

@@ -221,7 +221,8 @@ class DeploymentSource {
       ? sourceParser.getDestinationEnv(opts.updatedSourceEnv)
       : {};
     const sourceMinionPoolId =
-      opts?.updatedSourceEnv?.minion_pool_id || deployment.origin_minion_pool_id;
+      opts?.updatedSourceEnv?.minion_pool_id ||
+      deployment.origin_minion_pool_id;
     if (sourceMinionPoolId) {
       payload.deployment.origin_minion_pool_id = sourceMinionPoolId;
     }
@@ -255,7 +256,8 @@ class DeploymentSource {
           newMappings[k] = mergedMappings[k];
         }
       });
-      payload.deployment[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS] = newMappings;
+      payload.deployment[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS] =
+        newMappings;
     }
 
     delete updatedDestEnv[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS];
@@ -352,7 +354,8 @@ class DeploymentSource {
           newMappings[k] = minionPoolMappings[k];
         }
       });
-      payload.deployment[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS] = newMappings;
+      payload.deployment[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS] =
+        newMappings;
     } else {
       payload.deployment[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS] = null;
     }

+ 1 - 3
src/sources/NotificationSource.ts

@@ -79,9 +79,7 @@ class NotificationStorage {
 
 class DataUtils {
   static getItemDescription(item: ActionItem) {
-    const item_type = item.type === "transfer"
-      ? "transfer"
-      : "deployment";
+    const item_type = item.type === "transfer" ? "transfer" : "deployment";
     return `New ${item_type} ${item.id.substr(
       0,
       7

+ 2 - 5
src/sources/WizardSource.ts

@@ -70,8 +70,7 @@ class WizardSource {
 
     const destEnv = destParser.getDestinationEnv(data.destOptions);
     if (data.destOptions?.minion_pool_id) {
-      payload.destination_minion_pool_id =
-        data.destOptions.minion_pool_id;
+      payload.destination_minion_pool_id = data.destOptions.minion_pool_id;
     }
 
     const poolMappings = destEnv[INSTANCE_OSMORPHING_MINION_POOL_MAPPINGS];
@@ -106,9 +105,7 @@ class WizardSource {
       );
     }
 
-    const scenario = type == "replica"
-      ? "replica"
-      : "live_migration";
+    const scenario = type == "replica" ? "replica" : "live_migration";
     payload.scenario = scenario;
 
     const payload_body_key = "transfer";

+ 8 - 2
src/stores/ScheduleStore.ts

@@ -151,8 +151,14 @@ class ScheduleStore {
     unsavedData?: Schedule | null;
     forceSave?: boolean;
   }): Promise<void> {
-    const { transferId: transferId, scheduleId, data, oldData, unsavedData, forceSave } =
-      opts;
+    const {
+      transferId: transferId,
+      scheduleId,
+      data,
+      oldData,
+      unsavedData,
+      forceSave,
+    } = opts;
 
     if (!forceSave) {
       this.schedules = updateSchedule(this.schedules, scheduleId, data);

+ 8 - 2
src/stores/TransferStore.ts

@@ -207,7 +207,10 @@ class TransferStore {
       );
       this.transferDetails = updatedTransfer;
     }
-    this.getExecutionTasks({ transferId: transferId, executionId: execution.id });
+    this.getExecutionTasks({
+      transferId: transferId,
+      executionId: execution.id,
+    });
 
     this.startingExecution = false;
   }
@@ -225,7 +228,10 @@ class TransferStore {
     }
   }
 
-  async deleteExecution(transferId: string, executionId: string): Promise<void> {
+  async deleteExecution(
+    transferId: string,
+    executionId: string
+  ): Promise<void> {
     await TransferSource.deleteExecution(transferId, executionId);
     this.deleteExecutionSuccess(transferId, executionId);
   }

+ 3 - 2
src/utils/LabelDictionary.ts

@@ -89,8 +89,9 @@ const dictionary = {
   },
   shutdown_instances: {
     label: "Shutdown Instance(s)",
-    description: "This option can be used before completing the Deployment on the target cloud. After the source instance(s) shutdown, a last snapshot will be executed, in order to transfer the last bits of data to the target cloud, and the source instance(s) will be left stopped."
-  }
+    description:
+      "This option can be used before completing the Deployment on the target cloud. After the source instance(s) shutdown, a last snapshot will be executed, in order to transfer the last bits of data to the target cloud, and the source instance(s) will be left stopped.",
+  },
 };
 
 const cache: {

+ 5 - 2
tests/fileTransform.js

@@ -1,3 +1,6 @@
-const path = require('path');
+const path = require("path");
 
-module.exports = {  process: (_, filename) => `module.exports = ${JSON.stringify(path.basename(filename))}`}
+module.exports = {
+  process: (_, filename) =>
+    `module.exports = ${JSON.stringify(path.basename(filename))}`,
+};

+ 1 - 5
ui-mod-sample.json

@@ -1,11 +1,7 @@
 {
   "config": {
     "_comment": "Add any `config.js` property here to override it.",
-    "disabledPages": [
-      "planning",
-      "users",
-      "projects"
-    ],
+    "disabledPages": ["planning", "users", "projects"],
     "servicesUrls": {
       "keystone": "{BASE_URL}/identity",
       "barbican": "{BASE_URL}/barbican",