Skip to content

Commit

Permalink
Ran style formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanChen123 committed Jun 16, 2024
1 parent 85f42a1 commit 215fb2a
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/website/lib/dotenv.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ module.exports = () => {
};
};

export {}
export {};
2 changes: 1 addition & 1 deletion src/website/lib/redux/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ const middleware: Redux.Middleware[] = [
},
predicate: () => typeof window !== 'undefined',
}),
]
];

export { middleware };
2 changes: 1 addition & 1 deletion src/website/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CircularProgress, Modal } from '@mui/material';
import Header from '@/views/components/Header/Header';
import styles from './style.module.css';
import PolarisContainer from '@/views/components/Polaris/PolarisContainer';
import { clearLogsPeriodically } from '@/lib/redux/logUtils'
import { clearLogsPeriodically } from '@/lib/redux/logUtils';

const MapsContainer = dynamic(() => import('@/views/MapsContainer'), {
loading: () => <CircularProgress className={styles.loadingSpinner} />,
Expand Down
7 changes: 5 additions & 2 deletions src/website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"hooks/useSessionState.js"
, "lib/dotenv.js", "models/helper/parser.js", "utils/DownloadData.js" ],
"hooks/useSessionState.js",
"lib/dotenv.js",
"models/helper/parser.js",
"utils/DownloadData.js"
],
"exclude": ["node_modules"]
}
10 changes: 7 additions & 3 deletions src/website/views/DashboardContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { connect } from 'react-redux';
import UPlotLineChartComponent from './components/LineChart/UPlotLineChart';
import { GPS, GPSState } from '@/stores/GPS/GPSTypes';
import { Batteries, BatteriesState } from '@/stores/Batteries/BatteriesTypes';
import { WindSensor, WindSensors, WindSensorsState } from '@/stores/WindSensors/WindSensorsTypes';
import {
WindSensor,
WindSensors,
WindSensorsState,
} from '@/stores/WindSensors/WindSensorsTypes';
import { DataFilterState } from '@/stores/DataFilter/DataFilterTypes';
import UPlotMultiLineChartComponent from './components/LineChart/UPlotMultiLineChart';

Expand Down Expand Up @@ -219,10 +223,10 @@ class DashboardContainer extends React.PureComponent<DashboardContainerProps> {

if (
timestampISO >=
// @ts-ignore
// @ts-ignore
this._parseISOString(this.props.dataFilter.timestamps.startDate) &&
timestampISO <=
// @ts-ignore
// @ts-ignore
this._parseISOString(this.props.dataFilter.timestamps.endDate)
) {
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/website/views/MapsContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ class MapsContainer extends React.PureComponent<MapsContainerProps> {

if (
timestampISO >=
// @ts-ignore
// @ts-ignore
this._parseISOString(this.props.dataFilter.timestamps.startDate) &&
timestampISO <=
// @ts-ignore
// @ts-ignore
this._parseISOString(this.props.dataFilter.timestamps.endDate)
) {
return true;
Expand Down Expand Up @@ -125,7 +125,7 @@ class MapsContainer extends React.PureComponent<MapsContainerProps> {
longitude: 999,
speed: 999,
heading: 999,
timestamp: new Date().toISOString()
timestamp: new Date().toISOString(),
};
}
return gpsdata.at(-1);
Expand Down
7 changes: 6 additions & 1 deletion src/website/views/components/DropDown/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ interface SortableGraphProps {
setOrder: any;
}

const SortableGraph = ({ id, children, order, setOrder }: SortableGraphProps) => {
const SortableGraph = ({
id,
children,
order,
setOrder,
}: SortableGraphProps) => {
const { attributes, listeners, setNodeRef, transform, transition } =
useSortable({
id,
Expand Down
14 changes: 12 additions & 2 deletions src/website/views/components/LineChart/UPlotLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export default class UPlotLineChartComponent extends React.Component<
show: true,
spanGaps: false,
label: 'Time',
value: (self: any, rawValue: any, xValuesIndex: any, currentVal: any) => {
value: (
self: any,
rawValue: any,
xValuesIndex: any,
currentVal: any,
) => {
if (currentVal == null) {
let xValues = self.data[xValuesIndex];
let xValue = fmtDate(tzDate(xValues[xValues.length - 1]));
Expand All @@ -52,7 +57,12 @@ export default class UPlotLineChartComponent extends React.Component<
show: true,
spanGaps: false,
label: this.props.label,
value: (self: any, rawValue: any, yValuesIndex: any, currentVal: any) => {
value: (
self: any,
rawValue: any,
yValuesIndex: any,
currentVal: any,
) => {
if (currentVal == null) {
let yValues = self.data[yValuesIndex];
let yValue = yValues[yValues.length - 1]?.toFixed(2);
Expand Down
21 changes: 18 additions & 3 deletions src/website/views/components/LineChart/UPlotMultiLineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ export default class UPlotMultiLineChartComponent extends React.Component<
show: true,
spanGaps: false,
label: 'Time',
value: (self: any, rawValue: any, xValuesIndex: any, currentVal: any) => {
value: (
self: any,
rawValue: any,
xValuesIndex: any,
currentVal: any,
) => {
if (currentVal == null) {
let xValues = self.data[xValuesIndex];
let xValue = fmtDate(tzDate(xValues[xValues.length - 1]));
Expand All @@ -53,7 +58,12 @@ export default class UPlotMultiLineChartComponent extends React.Component<
show: true,
spanGaps: false,
label: this.props.labelOne,
value: (self: any, rawValue: any, yValuesIndex: any, currentVal: any) => {
value: (
self: any,
rawValue: any,
yValuesIndex: any,
currentVal: any,
) => {
if (currentVal == null) {
let yValues = self.data[yValuesIndex];
let yValue = yValues[yValues.length - 1]?.toFixed(2);
Expand All @@ -69,7 +79,12 @@ export default class UPlotMultiLineChartComponent extends React.Component<
show: true,
spanGaps: false,
label: this.props.labelTwo,
value: (self: any, rawValue: any, yValuesIndex: any, currentVal: any) => {
value: (
self: any,
rawValue: any,
yValuesIndex: any,
currentVal: any,
) => {
if (currentVal == null) {
let yValues = self.data[yValuesIndex];
let yValue = yValues[yValues.length - 1]?.toFixed(2);
Expand Down
4 changes: 2 additions & 2 deletions src/website/views/components/TimestampFilter/TimestampBtn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const TimestampBtn = ({ gps, dataFilter }: TimestampFilterBtnProps) => {
} to ${
dataFilter.timestamps.endDate
? fmtDate(tzDate(parseISOString(dataFilter.timestamps.endDate)))
// @ts-ignore
: fmtDate(tzDate(parseISOString(gps.data.at(-1).timestamp)))
: // @ts-ignore
fmtDate(tzDate(parseISOString(gps.data.at(-1).timestamp)))
}`}
</div>
<div
Expand Down

0 comments on commit 215fb2a

Please sign in to comment.