This commit is contained in:
Olivier Gagnon
2021-10-03 21:44:15 -04:00
8 changed files with 24 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -122,11 +122,22 @@ function WarehouseRoot(props: IProps): React.ReactElement {
</> </>
); );
} }
console.log(division.products);
for (const prodName in division.products) {
const prod = division.products[prodName];
if (prod === undefined) continue;
breakdown = (
<>
{breakdown}
{prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, "0,0.0")}
</>
);
}
return ( return (
<Paper> <Paper>
<Box display="flex" alignItems="center"> <Box display="flex" alignItems="center">
<Tooltip title={props.warehouse.sizeUsed !== 0 ? breakdown : ""}> <Tooltip title={props.warehouse.sizeUsed !== 0 ? <Typography>{breakdown}</Typography> : ""}>
<Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? "error" : "primary"}> <Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? "error" : "primary"}>
Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{" "} Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{" "}
{numeralWrapper.formatBigNumber(props.warehouse.size)} {numeralWrapper.formatBigNumber(props.warehouse.size)}

View File

@ -409,7 +409,6 @@ export class Sleeve extends Person {
return jobPerformance * this.company_rep_mult * favorMult; return jobPerformance * this.company_rep_mult * favorMult;
} else { } else {
console.warn(`Sleeve.getRepGain() called for invalid task type: ${this.currentTask}`);
return 0; return 0;
} }
} }

View File

@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import { EventEmitter } from "../../utils/EventEmitter"; import { EventEmitter } from "../../utils/EventEmitter";
import { Modal } from "../../ui/React/Modal"; import { Modal } from "../../ui/React/Modal";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Box from "@mui/material/Box";
export const AlertEvents = new EventEmitter<[string | JSX.Element]>(); export const AlertEvents = new EventEmitter<[string | JSX.Element]>();
@ -41,7 +42,9 @@ export function AlertManager(): React.ReactElement {
<> <>
{alerts.length > 0 && ( {alerts.length > 0 && (
<Modal open={true} onClose={close}> <Modal open={true} onClose={close}>
<Typography>{alerts[0].text}</Typography> <Box>
<Typography>{alerts[0].text}</Typography>
</Box>
</Modal> </Modal>
)} )}
</> </>

View File

@ -6,6 +6,6 @@ export function dialogBoxCreate(txt: string | JSX.Element): void {
if (typeof txt !== "string") { if (typeof txt !== "string") {
AlertEvents.emit(txt); AlertEvents.emit(txt);
} else { } else {
AlertEvents.emit(<pre dangerouslySetInnerHTML={{ __html: txt }} />); AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);
} }
} }

View File

@ -147,10 +147,10 @@ function LogWindow(props: IProps): React.ReactElement {
</Box> </Box>
</Paper> </Paper>
<Paper> <Paper>
<Box maxHeight="25vh" overflow="scroll"> <Box maxHeight="25vh" overflow="scroll" sx={{ overflowWrap: "break-word" }}>
{props.script.logs.map( {props.script.logs.map(
(line: string, i: number): JSX.Element => ( (line: string, i: number): JSX.Element => (
<Typography key={i} style={{ whiteSpace: "pre-line" }}> <Typography key={i}>
{line} {line}
<br /> <br />
</Typography> </Typography>