Skip to content

Commit

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

export const ItemContainer = styled(Box, {
shouldForwardProp: (prop) => prop !== "onTopVisible",
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
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
@@ -1,5 +1,5 @@
import { Box, Paper, styled } from "@mui/material";
import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "../../../../../../../../theme";
import { PAPER_BACKGROUND_NO_TRANSPARENCY } from "../../../../../../theme";

export const ConstraintElementRoot = styled(Paper)(({ theme }) => ({
display: "flex",
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
2 changes: 1 addition & 1 deletion 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
6 changes: 0 additions & 6 deletions webapp/src/components/App/Studies/HeaderBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function HeaderBottom(props: PropTypes) {
{filters.managed && (
<Chip
label={t("studies.managedStudiesFilter")}
variant="filled"
color="secondary"
onDelete={() => setFilterValue("managed", false)}
sx={{ mx: 1 }}
Expand All @@ -93,7 +92,6 @@ function HeaderBottom(props: PropTypes) {
{filters.archived && (
<Chip
label={t("studies.archivedStudiesFilter")}
variant="filled"
color="secondary"
onDelete={() => setFilterValue("archived", false)}
sx={{ mx: 1 }}
Expand All @@ -111,7 +109,6 @@ function HeaderBottom(props: PropTypes) {
<Chip
key={version}
label={displayVersionName(version)}
variant="filled"
color="primary"
onDelete={() => {
setFilterValue(
Expand All @@ -126,7 +123,6 @@ function HeaderBottom(props: PropTypes) {
<Chip
key={user.id}
label={user.name}
variant="filled"
onDelete={() => {
setFilterValue(
"users",
Expand All @@ -140,7 +136,6 @@ function HeaderBottom(props: PropTypes) {
<Chip
key={group.id}
label={group.name}
variant="filled"
color="success"
onDelete={() => {
setFilterValue(
Expand All @@ -155,7 +150,6 @@ function HeaderBottom(props: PropTypes) {
<Chip
key={tag}
label={tag}
variant="filled"
onDelete={() => {
setFilterValue(
"tags",
Expand Down
4 changes: 0 additions & 4 deletions webapp/src/components/App/Studies/LauncherDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ function LauncherDialog(props: Props) {
id="launcher-option-output-suffix"
label={t("global.name")}
type="text"
variant="filled"
value={options.output_suffix}
onChange={(e) =>
handleChange("output_suffix", e.target.value.trim())
Expand All @@ -264,7 +263,6 @@ function LauncherDialog(props: Props) {
id="launcher-option-time-limit"
label={t("study.timeLimit")}
type="number"
variant="filled"
value={(options.time_limit ?? 864000) / 3600} // 240 hours default
onChange={(e) =>
handleChange("time_limit", timeLimitParse(e.target.value))
Expand All @@ -287,7 +285,6 @@ function LauncherDialog(props: Props) {
id="nb-cpu"
label={t("study.nbCpu")}
type="number"
variant="filled"
value={options.nb_cpu}
onChange={(e) => {
const newValue = parseInt(e.target.value, 10);
Expand Down Expand Up @@ -333,7 +330,6 @@ function LauncherDialog(props: Props) {
id="other-options"
label={t("study.otherOptions")}
type="text"
variant="filled"
value={options.other_options}
onChange={(e) => handleChange("other_options", e.target.value)}
sx={{
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/App/Studies/SideNav.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useNavigate } from "react-router";
import { Box, Typography, List, ListItem, ListItemText } from "@mui/material";
import { useTranslation } from "react-i18next";
import { STUDIES_SIDE_NAV_WIDTH } from "../../../theme";
import { STUDIES_SIDE_NAV_WIDTH } from "../theme";
import StudyTree from "./StudyTree";
import useAppSelector from "../../../redux/hooks/useAppSelector";
import { getFavoriteStudies } from "../../../redux/selectors";
Expand Down
Loading

0 comments on commit 9f9fdca

Please sign in to comment.