Skip to content

Commit

Permalink
chore: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Nov 26, 2023
1 parent 0514f53 commit a7bcb7b
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 96 deletions.
3 changes: 2 additions & 1 deletion backend/lib/entities/ContainerEntity.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class ContainerEntity extends SerializableEntity {
*/
subscribe(subscriber, matcher) {
const metas = this.getAttributeSubscribersMetas(matcher, {exact: true});
let meta = null;
let meta;

Check failure on line 71 in backend/lib/entities/ContainerEntity.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Trailing spaces not allowed
if (metas.length > 0) {
meta = metas[0];
if (metas.length > 1) {
Expand Down
2 changes: 1 addition & 1 deletion backend/lib/mqtt/handles/MapNodeMqttHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const zlib = require("zlib");
class MapNodeMqttHandle extends NodeMqttHandle {
/**
* @param {object} options
* @param {import("./RobotMqttHandle")} options.parent}
* @param {import("./RobotMqttHandle")} options.parent
* @param {import("../MqttController")} options.controller MqttController instance
* @param {import("../../core/ValetudoRobot")} options.robot
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ const FanSpeedControlCapability = require("../../../core/capabilities/FanSpeedCo
* @extends FanSpeedControlCapability<import("../ViomiValetudoRobot")>
*/
class ViomiFanSpeedControlCapability extends FanSpeedControlCapability {
/**
* @returns {Array<string>}
*/
getFanSpeedPresets() {
return this.presets.map(p => {
return p.name;
});
}

/**
* @param {string} preset
* @returns {Promise<void>}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/icon_components/IterationsIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {FunctionComponent} from "react";
import React, {FunctionComponent} from "react";

/*
This icon was adapted from the bootstrap icons repeat-1 icon found here:
Expand Down
30 changes: 15 additions & 15 deletions frontend/src/components/ValetudoAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
IconButton,
List,
ListItem,
ListItemButton,
ListItemIcon,
ListItemText,
ListSubheader,
Expand Down Expand Up @@ -374,14 +375,17 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
const ItemIcon = value.menuIcon;

return (
<ListItem key={value.routeMatch} button
<ListItemButton
key={value.routeMatch}
selected={value.routeMatch === currentTab}
component={Link} to={value.routeMatch}>
component={Link}
to={value.routeMatch}
>
<ListItemIcon>
<ItemIcon/>
</ListItemIcon>
<ListItemText primary={value.menuText}/>
</ListItem>
</ListItemButton>
);
}
}
Expand All @@ -407,8 +411,7 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
sx={{background: "transparent"}}>
Links
</ListSubheader>
<ListItem
button
<ListItemButton
component="a"
href="./swagger/"
target="_blank"
Expand All @@ -418,10 +421,9 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
<SwaggerUIIcon/>
</ListItemIcon>
<ListItemText primary="Swagger UI"/>
</ListItem>
</ListItemButton>
<Divider/>
<ListItem
button
<ListItemButton
component="a"
href="https://valetudo.cloud"
target="_blank"
Expand All @@ -431,9 +433,8 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
<DocsIcon/>
</ListItemIcon>
<ListItemText primary="Docs"/>
</ListItem>
<ListItem
button
</ListItemButton>
<ListItemButton
component="a"
href="https://github.com/Hypfer/Valetudo"
target="_blank"
Expand All @@ -443,9 +444,8 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
<GithubIcon/>
</ListItemIcon>
<ListItemText primary="Hypfer/Valetudo"/>
</ListItem>
<ListItem
button
</ListItemButton>
<ListItemButton
component="a"
href="https://github.com/sponsors/Hypfer"
target="_blank"
Expand All @@ -455,7 +455,7 @@ const ValetudoAppBar: React.FunctionComponent<{ paletteMode: PaletteMode, setPal
<DonateIcon/>
</ListItemIcon>
<ListItemText primary="Donate"/>
</ListItem>
</ListItemButton>


</List>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/ValetudoSplash.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {ReactComponent as SplashLogo} from "../assets/icons/valetudo_splash.svg";
import {CircularProgress, Grid} from "@mui/material";
import React from "react";

const ValetudoSplash = (): React.ReactElement => {

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export * from "./useHTMLElement";
export * from "./useForkRef";
export * from "./useIsMobileView";
export * from "./useLocalStorage";
32 changes: 0 additions & 32 deletions frontend/src/hooks/useForkRef.ts

This file was deleted.

30 changes: 0 additions & 30 deletions frontend/src/hooks/useHTMLElement.ts

This file was deleted.

1 change: 1 addition & 0 deletions frontend/src/map/EditMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import NoMopAreaClientStructure from "./structures/client_structures/NoMopAreaCl
import HelpDialog from "../components/HelpDialog";
import HelpAction from "./actions/edit_map_actions/HelpAction";
import {ProviderContext} from "notistack";
import React from "react";

export type mode = "segments" | "virtual_restrictions";

Expand Down
1 change: 1 addition & 0 deletions frontend/src/map/EditMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import EditMap, { mode } from "./EditMap";
import {SegmentEditHelp} from "./res/SegmentEditHelp";
import {VirtualRestrictionEditHelp} from "./res/VirtualRestrictionEditHelp";
import {useSnackbar} from "notistack";
import React from "react";


const Container = styled(Box)({
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/map/LiveMapModeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const modeToLabel: Record<LiveMapMode, string> = {

/* eslint-disable react/display-name */
export const NoTransition = React.forwardRef< // https://stackoverflow.com/a/71617594
React.ReactFragment,
React.ReactElement,
TransitionProps
// eslint-disable-next-line @typescript-eslint/no-unused-vars
>(({ children }, ref) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/map/LiveMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Box, Button, CircularProgress, styled, Typography, useTheme} from "@mui/
import {Capability, useMapSegmentationPropertiesQuery, useRobotMapQuery} from "../api";
import LiveMap from "./LiveMap";
import {useCapabilitiesSupported} from "../CapabilitiesProvider";
import React from "react";


const Container = styled(Box)({
Expand Down
1 change: 1 addition & 0 deletions frontend/src/map/RobotCoverageMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import HelpAction from "./actions/edit_map_actions/HelpAction";
import {PathDrawer} from "./PathDrawer";
import {RawMapEntityType} from "../api";
import SegmentLabelMapStructure from "./structures/map_structures/SegmentLabelMapStructure";
import React from "react";


interface CleanupCoverageMapProps extends MapProps {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/map/RobotCoverageMapPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from "../api";
import RobotCoverageMap from "./RobotCoverageMap";
import {RobotCoverageMapHelp} from "./res/RobotCoverageMapHelp";
import React from "react";


const Container = styled(Box)({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract class LineClientStructure extends ClientStructure {
};


constructor(
protected constructor(
x0: number, y0: number,
x1: number, y1: number,
active: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {TouchHandlerEvent} from "./TouchHandlerEvent";

export class TapTouchHandlerEvent extends TouchHandlerEvent {
static TYPE = "tap";
static LONG_PRESS_DURATION = 150;

x0: number;
y0: number;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/robot/RobotRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {useRouteMatch} from "react-router-dom";
import Consumables from "./Consumables";
import ManualControl from "./ManualControl";
import TotalStatistics from "./TotalStatistics";
import React from "react";

const RobotRouter = (): React.ReactElement => {
const {path} = useRouteMatch();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/robot/TotalStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const StatisticsAward: React.FunctionComponent<{ achievement?: StatisticsAchieve
let ribbonFill;


if (achievement && achieved !== false) {
if (achievement && achieved) {
ribbonFill = "url(#ribbonGradient)";

if (theme.palette.mode === "light") {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/valetudo/ValetudoRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Log from "./Log";
import Updater from "./Updater";
import About from "./About";
import Help from "./Help";
import React from "react";

const ValetudoRouter = (): React.ReactElement => {
const {path} = useRouteMatch();
Expand Down
4 changes: 3 additions & 1 deletion util/build_release_manifest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require("fs");
const crypto = require("crypto");
const fs = require("fs");
const packageJson = require("../package.json");

const manifest = {
Expand Down Expand Up @@ -31,8 +31,10 @@ Object.values(binaries).forEach((path, i) => {
manifest.sha256sums[name] = checksum.digest("hex");
} catch(e) {
if(e.code === "ENOENT") {
// eslint-disable-next-line no-console
console.warn(`Couldn't find ${name} at ${path}`);
} else {
// eslint-disable-next-line no-console
console.error(e);
}
}
Expand Down

0 comments on commit a7bcb7b

Please sign in to comment.