Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
skamril committed Feb 20, 2024
1 parent e2c5e47 commit fd06634
Show file tree
Hide file tree
Showing 39 changed files with 404 additions and 474 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Accordion, Box, styled } from "@mui/material";
import DeleteIcon from "@mui/icons-material/HighlightOff";
import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "../../../../../../../theme";

export const ItemContainer = styled(Box, {
shouldForwardProp: (prop) => prop !== "onTopVisible",
Expand All @@ -15,7 +14,6 @@ export const DraggableAccorderon = styled(Accordion, {
})<{ isDragging?: boolean }>(({ theme, isDragging }) => ({
flex: 1,
boxSizing: "border-box",
backgroundColor: PAPER_BACKGROUND_NO_TRANSPARENCY,
...(isDragging
? {
borderColor: theme.palette.secondary.main,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ function DetailsList({ items }: Props) {
<List
sx={{
width: 1,
backgroundColor: "#222333",
}}
>
{items.map((item) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ContentState, convertToRaw, EditorState } from "draft-js";
import draftToHtml from "draftjs-to-html";
import { convertFromHTML } from "draft-convert";
import { Element as XMLElement, js2xml, xml2json } from "xml-js";
import theme from "../../../../../../theme";
import theme from "../../../../theme";

interface BlockMap {
from: string;
Expand Down Expand Up @@ -588,9 +588,9 @@ export const convertSize = (bytes: number): string => {

const sizeRanges = [
{ limit: 0, color: "default" }, // Size is unknown or not calculated
{ limit: 5 * BYTES_PER_GB, color: theme.palette.success.main }, // Size is 0 to 5 GB
{ limit: 25 * BYTES_PER_GB, color: theme.palette.warning.main }, // Size is 5 GB to 25 GB
{ limit: Infinity, color: theme.palette.error.main }, // Size is 25 GB and above
{ limit: 5 * BYTES_PER_GB, color: "palette.success.main" }, // Size is 0 to 5 GB
{ limit: 25 * BYTES_PER_GB, color: "palette.warning.main" }, // Size is 5 GB to 25 GB
{ limit: Infinity, color: "palette.error.main" }, // Size is 25 GB and above
];

export const getColorForSize = (bytes: number): string => {
Expand Down
13 changes: 3 additions & 10 deletions webapp/src/components/App/Singlestudy/NavHeader/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,11 @@ function Actions({
/>
</Tooltip>
{isManaged ? (
<Chip
label={t("study.managedStudy")}
variant="filled"
color="info"
size="small"
/>
<Chip label={t("study.managedStudy")} color="info" size="small" />
) : (
<Chip label={study.workspace} variant="filled" size="small" />
<Chip label={study.workspace} size="small" />
)}
{study.tags?.map((tag) => (
<Chip key={tag} label={tag} variant="filled" size="small" />
))}
{study.tags?.map((tag) => <Chip key={tag} label={tag} size="small" />)}
{isExplorer && (
<Button
size="small"
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/App/Singlestudy/NavHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import DeleteOutlinedIcon from "@mui/icons-material/DeleteOutlined";
import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
import { useTranslation } from "react-i18next";
import { StudyMetadata, VariantTree } from "../../../../common/types";
import { STUDIES_HEIGHT_HEADER } from "../../../../theme";
import { STUDIES_HEIGHT_HEADER } from "../../theme";
import { archiveStudy, unarchiveStudy } from "../../../../services/api/study";
import { deleteStudy } from "../../../../redux/ducks/studies";
import LauncherDialog from "../../Studies/LauncherDialog";
Expand Down
1 change: 0 additions & 1 deletion webapp/src/components/App/Singlestudy/UpgradeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ function UpgradeDialog({ study, onClose, open }: Props) {
<SelectFE
name="version"
label="Version"
variant="filled"
options={versionOptions}
control={control}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ function Fields(props: Props) {
<NumberFE
name="firstDay"
label={t("study.configuration.general.firstDay")}
variant="filled"
control={control}
rules={{
deps: "lastDay",
Expand All @@ -151,7 +150,6 @@ function Fields(props: Props) {
<NumberFE
name="lastDay"
label={t("study.configuration.general.lastDay")}
variant="filled"
control={control}
rules={{
deps: "firstDay",
Expand All @@ -160,12 +158,7 @@ function Fields(props: Props) {
/>
</Fieldset>
<Fieldset legend={t("study.configuration.general.legend.calendar")}>
<StringFE
name="horizon"
label="Horizon"
variant="filled"
control={control}
/>
<StringFE name="horizon" label="Horizon" control={control} />
<SelectFE
name="firstMonth"
label={t("study.configuration.general.year")}
Expand Down Expand Up @@ -207,7 +200,6 @@ function Fields(props: Props) {
<NumberFE
name="nbYears"
label={t("study.configuration.general.nbYears")}
variant="filled"
control={control}
rules={{
validate: handleNbYearsValidation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default function AddConstraintTermForm(props: Props) {
<NumberFE
name="weight"
label={t("study.modelization.bindingConst.weight")}
variant="filled"
control={control}
rules={{
required: t("form.field.required") as string,
Expand Down Expand Up @@ -76,7 +75,6 @@ export default function AddConstraintTermForm(props: Props) {
<NumberFE
name="offset"
label={t("study.modelization.bindingConst.offset")}
variant="filled"
control={control}
rules={{
required: t("form.field.required") as string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default function ConstraintItem(props: Props) {
left={
<TextField
label={t("study.modelization.bindingConst.weight")}
variant="filled"
type="number"
value={weight}
onChange={(e) => handleChange("weight", e.target.value)}
Expand Down Expand Up @@ -113,7 +112,6 @@ export default function ConstraintItem(props: Props) {
<OffsetInput onRemove={() => handleChange("offset", null)}>
<TextField
label={t("study.modelization.bindingConst.offset")}
variant="filled"
type="number"
value={offset}
onChange={(e) => handleChange("offset", e.target.value)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function ConstraintElement(props: ElementProps) {
<ConstraintElementHeader>
<Typography
sx={{
color: "grey.400",
fontSize: "16px",
}}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Box, Paper, styled } from "@mui/material";
import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "../../../../../../../../theme";

export const ConstraintElementRoot = styled(Paper)(({ theme }) => ({
display: "flex",
flexDirection: "column",
padding: theme.spacing(1),
backgroundColor: PAPER_BACKGROUND_NO_TRANSPARENCY,
}));

export const ConstraintElementHeader = styled(Box)(({ theme }) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function AreaConfig(props: Props) {
<TextField
sx={{ mt: 1 }}
label={t("study.modelization.map.areaName")}
variant="filled"
value={currentArea.name}
disabled
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function UpdateDistrictDialog(props: Props) {
<SelectFE
name="districtId"
label={t("study.modelization.map.districts")}
variant="filled"
options={districtsOptions}
control={control}
onChange={(e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ function UpdateLayerDialog(props: Props) {
<SelectFE
name="layerId"
label={t("Layers")}
variant="filled"
options={layersOptions}
control={control}
onChange={(e) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function CandidateForm(props: PropType) {
<Fields>
<TextField
label={t("global.name")}
variant="filled"
value={currentCandidate?.name || ""}
onChange={(e) => handleChange("name", e.target.value)}
/>
Expand All @@ -154,7 +153,6 @@ function CandidateForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.annualCost")}
variant="filled"
value={currentCandidate?.["annual-cost-per-mw"] || ""}
onChange={(e) =>
handleChange("annual-cost-per-mw", parseFloat(e.target.value))
Expand All @@ -163,7 +161,6 @@ function CandidateForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.alreadyICapacity")}
variant="filled"
value={currentCandidate?.["already-installed-capacity"] || ""}
onChange={(e) =>
handleChange(
Expand Down Expand Up @@ -206,7 +203,6 @@ function CandidateForm(props: PropType) {
sx={{ mr: 2 }}
type="number"
label={t("xpansion.unitSize")}
variant="filled"
value={currentCandidate?.["unit-size"] || ""}
onChange={(e) =>
handleChange("unit-size", parseFloat(e.target.value))
Expand All @@ -215,7 +211,6 @@ function CandidateForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.maxUnits")}
variant="filled"
value={currentCandidate?.["max-units"] || ""}
onChange={(e) =>
handleChange("max-units", parseFloat(e.target.value))
Expand All @@ -227,7 +222,6 @@ function CandidateForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.maxInvestments")}
variant="filled"
value={currentCandidate?.["max-investment"] || ""}
onChange={(e) =>
handleChange("max-investment", parseFloat(e.target.value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.maxIteration")}
variant="filled"
value={currentSettings.max_iteration}
onChange={(e) => handleChange("max_iteration", e.target.value)}
sx={{ mb: 1 }}
Expand All @@ -138,7 +137,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.optimalityGap")}
variant="filled"
value={currentSettings.optimality_gap}
onChange={(e) =>
handleChange("optimality_gap", parseFloat(e.target.value))
Expand All @@ -149,7 +147,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.relativeGap")}
variant="filled"
value={currentSettings.relative_gap}
onChange={(e) =>
handleChange("relative_gap", parseFloat(e.target.value))
Expand All @@ -160,7 +157,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.relaxedOptimalityGap")}
variant="filled"
value={currentSettings.relaxed_optimality_gap}
onChange={(e) =>
handleChange("relaxed_optimality_gap", e.target.value)
Expand All @@ -185,7 +181,7 @@ function SettingsForm(props: PropType) {
{/* <TextField
type="number"
label={t("xpansion.timeLimit")}
variant="filled"
value={Math.round((currentSettings.timelimit || 1e12) / 3600)}
onChange={(e) =>
handleChange(
Expand All @@ -198,7 +194,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.separationParameter")}
variant="filled"
value={currentSettings.separation_parameter}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
handleChange("separation_parameter", parseFloat(e.target.value))
Expand All @@ -209,7 +204,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.batchSize")}
variant="filled"
value={currentSettings.batch_size}
onChange={(e) =>
handleChange("batch_size", parseInt(e.target.value, 10))
Expand All @@ -220,7 +214,6 @@ function SettingsForm(props: PropType) {
<TextField
type="number"
label={t("xpansion.logLevel")}
variant="filled"
value={currentSettings.log_level}
onChange={(e) =>
handleChange("log_level", parseInt(e.target.value, 10))
Expand Down Expand Up @@ -343,7 +336,6 @@ function SettingsForm(props: PropType) {
e.target.value as string[],
)
}
variant="filled"
options={candidates}
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,12 @@ function Filter(props: PropTypes) {
<TextField
label={t("study.filterIn")}
value={filterInValue}
variant="filled"
onChange={(event) => setFilterInValue(event.target.value)}
sx={{ m: 0, mb: 2, width: "95%" }}
/>
<TextField
label={t("study.filterOut")}
value={filterOutValue}
variant="filled"
onChange={(event) => setFilterOutValue(event.target.value)}
sx={{ m: 0, mb: 2, width: "95%" }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ function TagSelect(props: PropTypes) {
<TextField
label={label}
value={value}
variant="filled"
onChange={(event) => setValue(event.target.value)}
sx={{ m: 0, mr: 1, flex: 1 }}
/>
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/components/App/Studies/FilterDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Toolbar from "@mui/material/Toolbar";
import Divider from "@mui/material/Divider";
import { Button, Drawer, List, ListItem, Typography } from "@mui/material";
import { useEffect, useRef } from "react";
import { STUDIES_FILTER_WIDTH } from "../../../theme";
import { STUDIES_FILTER_WIDTH } from "../theme";
import useAppSelector from "../../../redux/hooks/useAppSelector";
import {
getGroups,
Expand Down Expand Up @@ -93,7 +93,6 @@ function FilterDrawer(props: Props) {
flexDirection="column"
flexWrap="nowrap"
boxSizing="border-box"
color="white"
>
<Typography sx={{ color: "grey.500", fontSize: "0.9em", mb: 2 }}>
{t("global.filter").toUpperCase()}
Expand Down
Loading

0 comments on commit fd06634

Please sign in to comment.