diff --git a/lib/gui/app/components/flash-results/flash-results.tsx b/lib/gui/app/components/flash-results/flash-results.tsx index 886bb2cd..3bba7ec1 100644 --- a/lib/gui/app/components/flash-results/flash-results.tsx +++ b/lib/gui/app/components/flash-results/flash-results.tsx @@ -14,30 +14,29 @@ * limitations under the License. */ -import CircleSvg from '@fortawesome/fontawesome-free/svgs/solid/circle.svg'; -import CheckCircleSvg from '@fortawesome/fontawesome-free/svgs/solid/check-circle.svg'; -import TimesCircleSvg from '@fortawesome/fontawesome-free/svgs/solid/times-circle.svg'; -import outdent from 'outdent'; -import * as React from 'react'; -import { Flex, FlexProps, Link, TableColumn, Txt } from 'rendition'; -import styled from 'styled-components'; +import CircleSvg from "@fortawesome/fontawesome-free/svgs/solid/circle.svg"; +import CheckCircleSvg from "@fortawesome/fontawesome-free/svgs/solid/check-circle.svg"; +import TimesCircleSvg from "@fortawesome/fontawesome-free/svgs/solid/times-circle.svg"; +import * as React from "react"; +import { Flex, FlexProps, Link, TableColumn, Txt } from "rendition"; +import styled from "styled-components"; -import { progress } from '../../../../shared/messages'; -import { bytesToMegabytes } from '../../../../shared/units'; +import { progress } from "../../../../shared/messages"; +import { bytesToMegabytes } from "../../../../shared/units"; -import FlashSvg from '../../../assets/flash.svg'; -import { getDrives } from '../../models/available-drives'; -import { resetState } from '../../models/flash-state'; -import * as selection from '../../models/selection-state'; -import { middleEllipsis } from '../../utils/middle-ellipsis'; -import { Modal, Table } from '../../styled-components'; -import * as i18next from 'i18next'; +import FlashSvg from "../../../assets/flash.svg"; +import { getDrives } from "../../models/available-drives"; +import { resetState } from "../../models/flash-state"; +import * as selection from "../../models/selection-state"; +import { middleEllipsis } from "../../utils/middle-ellipsis"; +import { Modal, Table } from "../../styled-components"; +import * as i18next from "i18next"; const ErrorsTable = styled((props) => {...props} />)` - &&& [data-display='table-head'], - &&& [data-display='table-body'] { - > [data-display='table-row'] { - > [data-display='table-cell'] { + &&& [data-display="table-head"], + &&& [data-display="table-body"] { + > [data-display="table-row"] { + > [data-display="table-cell"] { &:first-child { width: 30%; } @@ -59,11 +58,11 @@ const DoneIcon = (props: { allFailed: boolean; }) => { const svgProps = { - width: '28px', + width: "28px", fill: props.color, style: { - marginTop: '-25px', - marginLeft: '13px', + marginTop: "-25px", + marginLeft: "13px", zIndex: 1, }, }; @@ -83,21 +82,21 @@ export interface FlashError extends Error { function formattedErrors(errors: FlashError[]) { return errors .map((error) => `${error.device}: ${error.message || error.code}`) - .join('\n'); + .join("\n"); } const columns: Array> = [ { - field: 'description', - label: i18next.t('flash.target'), + field: "description", + label: i18next.t("flash.target"), }, { - field: 'device', - label: i18next.t('flash.location'), + field: "device", + label: i18next.t("flash.location"), }, { - field: 'message', - label: i18next.t('flash.error'), + field: "message", + label: i18next.t("flash.error"), render: (message: string, { code }: FlashError) => { return message ?? code; }, @@ -119,7 +118,7 @@ function getEffectiveSpeed(results: { export function FlashResults({ goToMain, - image = '', + image = "", errors, results, skip, @@ -143,7 +142,7 @@ export function FlashResults({ const allFailed = !skip && results?.devices?.successful === 0; const someFailed = results?.devices?.failed !== 0 || errors?.length !== 0; const effectiveSpeed = bytesToMegabytes(getEffectiveSpeed(results)).toFixed( - 1, + 1 ); return ( @@ -159,16 +158,16 @@ export function FlashResults({ {middleEllipsis(image, 24)} {allFailed - ? i18next.t('flash.flashFailed') - : i18next.t('flash.flashCompleted')} + ? i18next.t("flash.flashFailed") + : i18next.t("flash.flashCompleted")} - {skip ? {i18next.t('flash.skip')} : null} + {skip ? {i18next.t("flash.skip")} : null} {results.devices.successful !== 0 ? ( @@ -192,7 +191,7 @@ export function FlashResults({ {progress.failed(errors.length)} setShowErrorsInfo(true)}> - {i18next.t('flash.moreInfo')} + {i18next.t("flash.moreInfo")} ) : null} @@ -201,11 +200,11 @@ export function FlashResults({ fontSize="10px" style={{ fontWeight: 500, - textAlign: 'center', + textAlign: "center", }} - tooltip={i18next.t('flash.speedTip')} + tooltip={i18next.t("flash.speedTip")} > - {i18next.t('flash.speed', { speed: effectiveSpeed })} + {i18next.t("flash.speed", { speed: effectiveSpeed })} )} @@ -215,11 +214,11 @@ export function FlashResults({ titleElement={ - {i18next.t('failedTarget')} + {i18next.t("failedTarget")} } - action={i18next.t('failedRetry')} + action={i18next.t("failedRetry")} cancel={() => setShowErrorsInfo(false)} done={() => { setShowErrorsInfo(false); @@ -230,7 +229,7 @@ export function FlashResults({ return drive.device; }) .filter((driveDevice) => - errors.some((error) => error.device === driveDevice), + errors.some((error) => error.device === driveDevice) ) .forEach((driveDevice) => selection.selectDrive(driveDevice)); goToMain();